my $success = eval { call_that_might_go_wrong(); 1; }; unless ($success) { print "Something went wrong: $@"; }