diff options
author | Michael G Schwern <schwern@pobox.com> | 2001-08-22 12:03:00 -0400 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2001-08-22 19:36:39 +0000 |
commit | d23f020529b1cb2636f0fbed24f1fc13fd63eac2 (patch) | |
tree | d97bd75e29bd809300a19d463d12935884cdc094 /lib/diagnostics.pm | |
parent | 5479d1922c9c0436fce71aca57c0f7e68ece0b49 (diff) | |
download | perl-d23f020529b1cb2636f0fbed24f1fc13fd63eac2.tar.gz |
[ID 20010822.007] eval STRING & diagnostics.pm not mixing
Message-Id: <20010822200300.0D1638253@ool-18b93024.dyn.optonline.net>
p4raw-id: //depot/perl@11726
Diffstat (limited to 'lib/diagnostics.pm')
-rwxr-xr-x | lib/diagnostics.pm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm index 4ef9a2f64d..b2249430b2 100755 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -476,11 +476,18 @@ sub death_trap { if (caller eq $WHOAMI) { print STDERR "INTERNAL EXCEPTION: $exception"; } &$olddie if defined $olddie and $olddie and $olddie ne \&death_trap; + return if $in_eval; + # We don't want to unset these if we're coming from an eval because - # then we've turned off diagnostics. (Actually what does this next - # line do? -PSeibel) - $SIG{__DIE__} = $SIG{__WARN__} = '' unless $in_eval; + # then we've turned off diagnostics. + + # Switch off our die/warn handlers so we don't wind up in our own + # traps. + $SIG{__DIE__} = $SIG{__WARN__} = ''; + + # Have carp skip over death_trap() when showing the stack trace. local($Carp::CarpLevel) = 1; + confess "Uncaught exception from user code:\n\t$exception"; # up we go; where we stop, nobody knows, but i think we die now # but i'm deeply afraid of the &$olddie guy reraising and us getting |