Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Can you explain the result?

by choroba (Chancellor)
on Dec 06, 2011 at 13:33 UTC ( #942021=note: print w/replies, xml ) Need Help??


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

It does. Try with print instead of return to see.

Replies are listed 'Best First'.
Re^4: Can you explain the result?
by Anonymous Monk on Dec 06, 2011 at 13:36 UTC
    Do you mean the priority of and is even lower than return???
      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."

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

      --MidLifeXis

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://942021]
help
Chatterbox?
[stevieb]: I've finally added the ability for berrybrew to fetch the list of perls available directly from Strawberry's releases.json file. Instead of pulling from there on every single call, I've added a berrybrew fetch, so it's only updated..
[stevieb]: ...on request. There's some supporting work I need to do, as well as update the docs, but it's in the v1.12 branch if anyone wants to play with it...
[stevieb]: ...issue 62 will track what else needs to be done.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2017-03-31 01:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (364 votes). Check out past polls.