If you're using Perl 5.10, you have the defined-or operator //:
$foo //= $bar; # equivalent to $foo = $bar if defined $bar;
In reply to Re: Assignment to a value only if it is defined
by Corion
in thread Assignment to a value only if it is defined
by voj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |