No such thing as a small change | |
PerlMonks |
Re^3: conditional print. Is correct to use it?by hippo (Bishop) |
on Oct 28, 2020 at 21:19 UTC ( [id://11123282]=note: print w/replies, xml ) | Need Help?? |
I think kcott is saying that you might, in some conditions, wish to retain the non-empty false value in $x rather than discard it in favour of $y. eg. if 0 were a valid input for $x and you had:
You would see 10 rather than the valid-but-false 0. In such cases $number = $x // $y; might be more appropriate. 🦛
In Section
Seekers of Perl Wisdom
|
|