- The wrong way ...
my $error = do { local($@); eval { do_something() }; $@; } if($error) { cleanup(); die "Failed in do_something: $error"; }
my $error = do { local($@); eval { do_something() }; $@; } if($error) { cleanup(); die "Failed in do_something: $error"; }