Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: comparison of character

by Anonymous Monk
on Jul 16, 2013 at 11:21 UTC ( #1044557=note: print w/ replies, xml ) Need Help??


in reply to comparison of character

probably because you used || instead of or its  (...) || (...) ... or  ... or ... or ...

You're typing "||" when you should be using "or"

Common Perl Pitfalls / perltrap , "or die" versus "|| die", and two more To || or not to or and why., Perl Idioms Explained - && and || "Short Circuit" operators, || die or or die :)


Comment on Re: comparison of character
Select or Download Code
Re^2: comparison of character
by Anonymous Monk on Jul 16, 2013 at 11:22 UTC
    AND IM SLEEPY WRONG FOOL
Re^2: comparison of character
by Laurent_R (Prior) on Jul 16, 2013 at 11:40 UTC

    probably because you used || instead of or its (...) || (...) ... or ... or ... or ...

    As already pointed out by others, it should really be a logical and, not a logical or.

      As already pointed out by others, it should really be a logical and, not a logical or.

      AND IM SLEEPY WRONG FOOL 20min ago, not every foolish post needs multiple followups :)

        Sorry, I had not seen your follow-up or not understood it properly.

Re^2: comparison of character
by MidLifeXis (Monsignor) on Jul 16, 2013 at 13:03 UTC

    No. According to perlop, eq has a higher precedence than || and or, so, in this case, either one will do the same thing.

    I tend to use || for logical tests (X || Y) and or for flow control (STMT or die...).

    Update: clarified word choice a bit.

    --MidLifeXis

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2015-07-01 20:30 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 (19 votes), past polls