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

Re: To || or not to or and why.

by dws (Chancellor)
on Sep 15, 2003 at 22:21 UTC ( #291671=note: print w/replies, xml ) Need Help??


in reply to To || or not to or and why.

I want to pass a value to a class method. If the value is undef, then I want it to immediately return undef.

What's wrong with splitting this into two statements?

my $RootDirectoryCandidate = shift(); return unless defined($RootDirectoryCandidate);
You still get the immediate return, the result is more readable, and I really doubt you could measure a performance difference.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2022-07-04 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?