Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: weird begginer's problem...

by MidLifeXis (Prior)
on Sep 06, 2012 at 16:23 UTC ( #992135=note: print w/ replies, xml ) Need Help??


in reply to weird begginer's problem...

A preference as well, although it may save you some trouble later:

foo() || die "bar"

vs

foo() or die "bar"

The || is of higher precedence than or. Using or (at least in the action or die pattern) can help avoid some sneaky precedence bugs.

Update: Added example below

perl -e 'print 1 - 1 || die "hello"'

vs

perl -e 'print 1 - 1 or die "hello"'

--MidLifeXis


Comment on Re: weird begginer's problem...
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (14)
As of 2014-08-01 14:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (25 votes), past polls