in reply to Re: in search of a more elegant if then else
in thread in search of a more elegant if then else
# Use default when val is my $var = $val || $default; # ... false (= stringifies to '' or '0'). my $var = $val // $default; # ... undefined. (Requires Perl 5.10.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: in search of a more elegant if then else
by fullermd (Vicar) on Feb 19, 2010 at 06:34 UTC |