Subject: | __DIE__ signal handler captures error wrapped by eval |
I noticed that the __DIE__ signal handler captures any error even if it is wrapped by an eval statement. That means exceptions cannot be handled properly.
I found a way out which is to replace the __DIE__ signal handler by the following:
local $SIG{__DIE__} = sub {
my ($package, $filename, $line, $subroutine) = caller(1);
if (!$subroutine || $subroutine ne '(eval)') {
$xslate_err = shift;
}
};