ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
Re: [PATCH] Precedence nit in Test::Builder
by Vincent Pit other posts by this author
Aug 29 2008 10:06AM messages near this date
Re: [PATCH] Precedence nit in Test::Builder | Re: [PATCH] Precedence nit in Test::Builder
> > -    $self->_whoa(!$self->{Have_Plan} and $self->{Curr_Test},
> > +    $self->_whoa(!$self->{Have_Plan} && $self->{Curr_Test},
> >           'Somehow your tests ran without a plan!');
> >     
> 
> 
>  Really?  My research indicates that the comma is lower than either
>  form of and, in both scalar and array contexts:
> 
>  $ perl -le 'print ( @x=(!0 and 2,3))'
>  23
> 
>  $ perl -le 'print ( @x=(!0 && 2,3))'
>  23
> 
>  $ perl -le 'print ( $x=(!0 && 2,3))'
>  3
> 
>  $ perl -le 'print ( $x=(!0 and 2,3))'
>  3
>    
You two first examples shows that it's higher. Also, when in doubt, I
ask Deparse, and it told me :

$ perl -MO=Deparse,-p -e '!$x and $y, "foo"'
((not $x) and ($y, '???'));
Thread:
Vincent Pit
David Nicol
Vincent Pit
David Nicol

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved