in reply to Re^2: conditional print. Is correct to use it?
in thread conditional print. Is correct to use it?
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:
$x = 0; $y = 10; $number = $x || $y; print "$number\n";
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