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

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

Thread Previous | Thread Next
From:
Eric Brine
Date:
October 1, 2011 00:54
Subject:
Re: [perl #100364] exit doesn't match its documentation
Message ID:
CALJW-qEmpB+u1_y=SQX47rCMgFRkzAp0Tc5YBkTreHXUAo1OfQ@mail.gmail.com
On Sat, Oct 1, 2011 at 2:26 AM, Zefram <zefram@fysh.org> wrote:

> Eric Brine wrote:
> >Sorry if I wasn't clear, but you missed my point. I was saying that your
> >syntaxes don't allow for C<exit(1,2)>, which is allowed.
>
> No, it's not:
>
> $ perl -lwe 'exit(1,2)'
> Too many arguments for exit at -e line 1, near "2)
> "
> Execution of -e aborted due to compilation errors.
>
> -zefram
>

Ack, I thought the list was executed in scalar context. Don't know what I
was thinking. Anyway, 3+4 and 5 || 6 aren't terms, but exit(3+4) and exit(5
|| 60) are allowed. Tested this time:

>perl -we"exit(3+4)"

>echo %ERRORLEVEL%
7

>perl -we"exit(5||6)"

>echo %ERRORLEVEL%
5

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About