my $ok = 0; eval { do_something_that_might_die(); $ok = 1; }; if(!$ok) { shout_at_user(); }