develooper Front page | perl.perl5.porters | Postings from August 2008

Re: [PATCH] Precedence nit in Test::Builder

Thread Previous | Thread Next
From:
David Nicol
Date:
August 29, 2008 09:39
Subject:
Re: [PATCH] Precedence nit in Test::Builder
Message ID:
934f64a20808290939o40a7452q83731bf7f757dd2d@mail.gmail.com
> -    $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

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