in reply to To return and/or not?

With this

return $a and not $b

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.