sub try (&@) { my($try,$catch) = @_; eval { &$try }; if ($@) { local $_ = $@; &$catch; } } sub catch (&) { $_[0] } try { die "phooey"; } catch { /phooey/ and print "unphooey\n"; };
| "There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith |
In reply to Re: Re: Re: Exception handling (alternatives)
by vladb
in thread Exception handling (alternatives)
by vladb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |