BrowserUk is spot on. Just by wrapping the expression in parenthesis, you'll get the same results from both functions:
sub c2 { my ($a, $b) = @_; return ($a and not $b) }
I went down a rabbit hole and was playing with Devel::Peek and trying to find clues as to why the returned values were different. Oh, well...
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: To return and/or not?
by roboticus
in thread To return and/or not?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |