Subject: | die handler needs to check $^S properly |
$^S can be 1 or undef if we are either in an eval or parsing an eval, respectively.
IE
die $msg if $^S;
should be:
die $msg if $^S or not defined $^S;
[perldoc perlvar:
$EXCEPTIONS_BEING_CAUGHT
$^S Current state of the interpreter.
$^S State
--------- -------------------
undef Parsing module/eval
true (1) Executing an eval
false (0) Otherwise
The first state may happen in $SIG{__DIE__} and $SIG{__WARN__} handlers.
]
You can trivially test this with perl -MCGI::Alert -e 'eval qq(BEGIN{die});'