my $ok = eval { do_something(); 1 }; if (! $ok){ handle_exception(); # possibly use contents of $@ } #### handle_exception() if ! $ok; #### croak "damned module failed with a confusing error\n" if ! $ok;
## handle_exception() if ! $ok; ##
## croak "damned module failed with a confusing error\n" if ! $ok;