[Israel.pm] A bug in Perl ?

Jason Elbaum jason.elbaum at gmail.com
Thu Feb 8 04:09:00 PST 2007


No. && has higher precedence than ||, so this parses as (1 || (0 &&
0)), which is equivalent to (1 || 0).

See http://www.perl.com/doc/manual/html/pod/perlop.html

Regards,

Jason Elbaum


On 2/8/07, Yossi Itzkovich <Yossi.Itzkovich at ecitele.com> wrote:
> Hi,
>
> For this code:
> perl -we '$a=(1||0&&0); print  $a'
> I get "1",  although I should get "0"  .
>
> Isn't it a bug ?
>
> I am using perl v5.8.4
>
> Thanks
>
> Yossi
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
>



More information about the Perl mailing list