# Use default when val is my $var = $val || $default; # ... false (= stringifies to '' or '0'). my $var = $val // $default; # ... undefined. (Requires Perl 5.10.)
In reply to Re^2: in search of a more elegant if then else
by ikegami
in thread in search of a more elegant if then else
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |