try { die "foobar"; } catch Error with { my $error = shift; print "failed: $error\n"; exit; }; print "ok";
Make sure you don't leave off the last semi-colon after the catch block, or it won't work.
In reply to Re: Re: Re: Exception handling (alternatives)
by perrin
in thread Exception handling (alternatives)
by vladb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |