http://qs321.pair.com?node_id=818505


in reply to Re^2: Assignment to a value only if it is defined
in thread Assignment to a value only if it is defined

Because the other part of the statement ($foo) is duplicated - if I have a long variable like $myhash{mykey}->{mykey2} instead of $foo it only gets uglier

Then try:

$_ = $bar // $_ for $myhash->{mykey}{mykey2};