Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Variable assignment after logical OR

by ikegami (Patriarch)
on Oct 02, 2007 at 19:03 UTC ( [id://642206]=note: print w/replies, xml ) Need Help??


in reply to Variable assignment after logical OR

You have a precedence problem.

General rule:
Use or to join statments together (where you'd otherwise use an if).
Use || when you'll use the result of the operation (i.e. in an assignment, to pass to a function, etc).

Omitting parens from function calls has a few pitfalls, including this one. You might be better off using them.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://642206]
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-19 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found