Skip to content

Instantly share code, notes, and snippets.

@esobchenko
Created October 15, 2009 09:50
Show Gist options
  • Save esobchenko/210860 to your computer and use it in GitHub Desktop.
Save esobchenko/210860 to your computer and use it in GitHub Desktop.
my ( $error, $failed );
{
local $@;
$failed = not eval {
# ...;
return 1;
};
$error = $@;
}
if ( $failed ) {
warn "got error: $error";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment