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
|