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

{local $_ = $bar; $foo = $_ if defined $_;}

$foo = $_ for grep defined, expensive();