Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: comparison of character

by Anonymous Monk
on Jul 16, 2013 at 11:21 UTC ( [id://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 :)

Replies are listed 'Best First'.
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

Re^2: comparison of character
by Laurent_R (Canon) 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 Anonymous Monk on Jul 16, 2013 at 11:22 UTC
    AND IM SLEEPY WRONG FOOL

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-24 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found