eval { ... something that can die ... #insures we never go into the do block except when we die return 1; } or do { my $e=$@; #the exception ... exception handling here ... };