#! /usr/bin/perl use strict ; use warnings ; sub try (&@) { my($try,$catch) = @_; eval { &$try }; if ($@) { $catch; } } sub catch (&) { &{$_[0]} } try { die "phooey"; } catch { print "unphooey\n"; }; catch { print "test\n"; } ;