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?
You still get the immediate return, the result is more readable, and I really doubt you could measure a performance difference.my $RootDirectoryCandidate = shift(); return unless defined($RootDirectoryCandidate);
In Section
Seekers of Perl Wisdom