Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Can you explain the result?

by Anonymous Monk
on Dec 06, 2011 at 13:36 UTC ( #942024=note: print w/ replies, xml ) Need Help??


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

Do you mean the priority of and is even lower than return???


Comment on Re^4: Can you explain the result?
Select or Download Code
Re^5: Can you explain the result?
by Utilitarian (Vicar) on Dec 06, 2011 at 14:17 UTC
    Indeed it is, if you want something evaluated put it in parenthesis to be sure
    return (1 and 0);
    returns 0 as you would expect.

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
Re^5: Can you explain the result?
by Anonymous Monk on Dec 06, 2011 at 15:09 UTC

    Indeed. and 'n or are good for control flow such as replacing simple error-handling ifs, while && 'n || are your standard Boolean logic operators.

Re^5: Can you explain the result?
by MidLifeXis (Prior) on Dec 06, 2011 at 18:01 UTC

    See perlop for the precedence table. not, and, or, and xor are all at the bottom of the table.

    --MidLifeXis

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-04-25 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (585 votes), past polls