Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Can you explain the result?

by RMGir (Prior)
on Dec 06, 2011 at 13:34 UTC ( [id://942022]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Can you explain the result?
in thread Can you explain the result?

As choroba said, return 1&&0 is different from return 1 and 0.

$ perl -MB::Deparse -e' sub f{return 1 and 0;}; sub g{return 1 && 0}; $deparse=B::Deparse->new(); print "f(): ",$deparse->coderef2text(\&f),"\n"; print "g(): ",$deparse->coderef2text(\&g),"\n";' f(): { 0 if return 1; } g(): { return 0; }

Mike

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2024-04-23 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found