#! /usr/bin/perl -l use strict ; use warnings ; sub try (&@) { my($try,$catch) = @_; eval { &$try }; if ($@) { $catch; } } sub catch (&) { &{$_[0]} } try { die "phooey"; } catch { /phooey/ and print "unphooey\n"; }; __END__ output: Use of uninitialized value in pattern match (m//) at ./tc.pl line 18