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 reply to Re^3: conditional print. Is correct to use it?
by hippo
in thread conditional print. Is correct to use it?
by pvaldes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |