do{print, return $_ for "1\nError was $foo\n"} if $foo;