This reverts commit
019070c31184a4deb57cb85f7e597a789c6c5b54.
I misunderstood $^S, and thought I could simplify the code. Contrary
to what perlvar says, $^S is undefined not only during compilation of
an eval or module, but also during compilation of the main program.
# 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"; }