Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by dws (Chancellor)
on Sep 15, 2003 at 22:21 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (1)
As of 2024-04-25 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found