in reply to Assignment to a value only if it is defined
If you're using Perl 5.10, you have the defined-or operator //:
$foo //= $bar; # equivalent to $foo = $bar if defined $bar;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Assignment to a value only if it is defined
by JavaFan (Canon) on Jan 20, 2010 at 10:56 UTC | |
|
Re^2: Assignment to a value only if it is defined
by almut (Canon) on Jan 20, 2010 at 10:48 UTC |