http://qs321.pair.com?node_id=39345

Adam has asked for the wisdom of the Perl Monks concerning the following question:

So I was working with $SIG{__DIE__} trying to do some fancy stuff and I discovered that $SIG{__DIE__} gets called from within an eval block! This was really not cool since I wanted to use the eval block to capture the die. Sigh. Any ideas?
#!perl -w use strict; $SIG{__DIE__} = sub { print "SIG DIE called!\n", caller, $/ }; eval qq{die 'inside eval!'}; print uc($@); __END__ The above code, when run, outputs: SIG DIE called! main(eval 1)1 INSIDE EVAL! AT (EVAL 1) LINE 1.