Problems? Is your data what you think it is? | |
PerlMonks |
Re: To return and/or not?by BrowserUk (Patriarch) |
on Oct 07, 2011 at 23:57 UTC ( [id://930267]=note: print w/replies, xml ) | Need Help?? |
With this
The return happens first, and regardless of the value of $a. The rest of the line is therefore never even considered. With this: $a and not $b the and is evaluated first, then the not $b if $a is false; then whatever is the result of that is returned by virtue of 'falling off the end' of the subroutine. You might use return $a && !$b instead. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|