Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: and vs &&

by marcussen (Pilgrim)
on Feb 12, 2009 at 01:00 UTC ( #743213=note: print w/ replies, xml ) Need Help??


in reply to and vs &&

To eliminate doubts about the right hand condition evaluating to an anonymous list with one entry of the value 0, which evaluates to true I would like to append the following;

$ perl -e 'my $a=(1 == 1) and 0;print "$a\n";' 1

Confucius says kill mosquito unless cannon


Comment on Re: and vs &&
Download Code
Re^2: and vs &&
by chromatic (Archbishop) on Feb 12, 2009 at 07:35 UTC
    To eliminate doubts about the right hand condition evaluating to an anonymous list with one entry of the value 0....

    Where do you see a list in that code?

      I never saw a list, but as parentheses are also used to enforce list context someone might percieve (0) to be 0 in list context. I hope that explains my cryptic clarification :)

      Confucius says kill mosquito unless cannon

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://743213]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2015-07-03 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls