summaryrefslogtreecommitdiff
path: root/lib/diagnostics.pm
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-07-29 00:03:45 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-07-29 00:14:08 -0700
commit019070c31184a4deb57cb85f7e597a789c6c5b54 (patch)
treecfe5f65a07abc5ab38de228f9bb2a6fe1553cd6d /lib/diagnostics.pm
parentc369a25dcc5e5c5b627a50d1c4b73c2be0b926b9 (diff)
downloadperl-019070c31184a4deb57cb85f7e597a789c6c5b54.tar.gz
Use $^S instead of caller in splain
Diffstat (limited to 'lib/diagnostics.pm')
-rw-r--r--lib/diagnostics.pm9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm
index 82fa700008..c734c852be 100644
--- a/lib/diagnostics.pm
+++ b/lib/diagnostics.pm
@@ -546,14 +546,7 @@ sub death_trap {
# See if we are coming from anywhere within an eval. If so we don't
# want to explain the exception because it's going to get caught.
- my $in_eval = 0;
- my $i = 0;
- while (my $caller = (caller($i++))[3]) {
- if ($caller eq '(eval)') {
- $in_eval = 1;
- last;
- }
- }
+ my $in_eval = $^S || !defined $^S;
splainthis($exception) unless $in_eval;
if (caller eq $WHOAMI) { print STDERR "INTERNAL EXCEPTION: $exception"; }