Executes like this:try { die "foobar\n"; print "OK"; } catch { print "FAILED!\n"; };
In other words, there are two arguments to try(): a coderef and whatever catch() returns (normally a coderef, its own first argument). So catch() has to be called before try() can be called.try( sub { die "Foobar"; print "OK"; }, catch(sub { print "FAILED!\n"; }) );
In reply to Re: Sub prototypes...
by Fastolfe
in thread Sub prototypes...
by vladb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |