http://www.perlmonks.org?node_id=63742


in reply to Re: Tricks with DBI
in thread Tricks with DBI

This is documented in eval. Here is how it works:
eval {call_function_that_may_die()}; if ($@) { # This is your error case print "Caught a die saying '$@'\n"; }