in reply to Re: Assignment to a value only if it is defined
in thread Assignment to a value only if it is defined
What the OP wants is:$foo = $bar unless defined $foo;
which is equivalent to$foo = $bar // $foo;
assuming the absence of ties and overloading.$foo = $bar if defined $bar;
|
|---|