#!/usr/bin/perl -w $SIG{__DIE__} = sub { print "Dead\n"; }; die "Blah"; END { print "This is the end, my friend.\n"; } #### Dead blah at ./foo.pl line 5. This is the end, my friend. #### #!/usr/bin/perl -w die "Blah"; $SIG{__DIE__} = sub { print "Dead\n"; }; END { print "This is the end, my friend.\n"; } #### Blah at ./foo.pl line 3. This is the end, my friend.