This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Make comment more accurate
[perl5.git] / lib / diagnostics.pm
index c734c85..1efbd67 100644 (file)
@@ -186,7 +186,7 @@ use 5.009001;
 use Carp;
 $Carp::Internal{__PACKAGE__.""}++;
 
-our $VERSION = '1.31';
+our $VERSION = '1.30';
 our $DEBUG;
 our $VERBOSE;
 our $PRETTY;
@@ -546,7 +546,14 @@ 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 = $^S || !defined $^S;
+    my $in_eval = 0;
+    my $i = 0;
+    while (my $caller = (caller($i++))[3]) {
+      if ($caller eq '(eval)') {
+       $in_eval = 1;
+       last;
+      }
+    }
 
     splainthis($exception) unless $in_eval;
     if (caller eq $WHOAMI) { print STDERR "INTERNAL EXCEPTION: $exception"; }