{ our @handlers; sub my_die { for (@handlers) { return if $_->(@_); } die(@_); }; sub try { my $fn = shift; local @handlers = (@_, @handlers); $fn->(); } sub blah { my_die 'omg!'; } sub unblah { try sub { blah() }, sub { if ($_[0] =~ /!/) { print "ok\n"; 1 } }; } unblah() }
In reply to Re: Can we continue after an exception?
by educated_foo
in thread Can we continue after an exception?
by dgaramond2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |