my $result; if (!eval { ... $result = ...; 1; }) { die("Unable to ...: $@\n"); } #### local $SIG{'__DIE__'} = sub { die($@) if $^S; ... };