Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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.


      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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://942021]
[Discipulus]: my dear white rabbit.. still invalid range in regex
[Discipulus]: oops sorry it was wrong 5.14, with 5.24 it runs fine
[Discipulus]: and shows choroba: ⦗RABBIT FACE⦘
[choroba]: yes
[choroba]: oh wait, the new code doesn't run in 5.14?
[choroba]: so maybe the previous version worked in 5.24, too
[Discipulus]: nope
[choroba]: oh ok
[choroba]: so, each character outside the \0 - \ffff range gets replaced by its name
[Discipulus]: the latest version works in 5.24 and not in 5.14. previous one worked on both but crashed on both with merry rabbit

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2017-09-19 11:38 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (218 votes). Check out past polls.