return $x if (defined (my $x=foo())); # or defined (my $x = foo()) && return $x;