develooper Front page | perl.perl5.porters | Postings from September 2011

Re: [perl #100364] exit doesn't match its documentation

Thread Previous | Thread Next
September 30, 2011 13:42
Re: [perl #100364] exit doesn't match its documentation
Message ID:
Eric Brine wrote:
>I don't see how that helps. <<1,2>> was given as an example of a problematic
>expression and it is neither arithemtic nor a term.

That's precisely how it helps.  "exit 1,2" doesn't match either of the
forms that I listed, for exactly that reason, and indeed it's not parsed
with "1,2" as the argument.  "1", however, *is* an arithmetic expression,
and so in "exit 1,2" the argument to exit is the "1".

>That and arithmetic expressions don't necessarilly start with parens.

Yes, precisely.  The only arithmetic expressions that you can use with
the "exit ARITHEXPR" form are the ones that don't start with parens.

>the syntax simply the following:
>   exit TERM
>A TERM is a simple value or an expression in parenthesis.

That's not what "term" means in the Perl grammar.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About