Skip to content

Instantly share code, notes, and snippets.

@ynonp
Created July 4, 2012 08:24
Show Gist options
  • Save ynonp/3046076 to your computer and use it in GitHub Desktop.
Save ynonp/3046076 to your computer and use it in GitHub Desktop.
use v5.10;
use threads;
use Try::Tiny;
my $t = threads->create(sub {
my $error = 0;
try {
a();
} catch {
$error = $_;
};
return $error;
});
my $retval = $t->join;
say "---";
say "retval = $retval";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment