# Try and catch using prototypes. (Almost verbatim from perlsub.) sub try (&$) { my ($try, $catch) = @_; eval { &$try; }; if ($@) { local $_ = $@; &$catch; } } sub catch (&) { $_[0] } try { die "phooey"; } catch { /phooey/ and print "unphooey\n"; };