diff options
Diffstat (limited to 'lib/diagnostics.pm')
-rw-r--r-- | lib/diagnostics.pm | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm index d6a5caf230..a85f282044 100644 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -208,7 +208,6 @@ unshift @trypod, "./pod/perldiag.pod" if -e "pod/perldiag.pod"; (my $PODFILE) = ((grep { -e } @trypod), $trypod[$#trypod])[0]; $DEBUG ||= 0; -my $WHOAMI = ref bless []; # nobody's business, prolly not even mine local $| = 1; local $_; @@ -238,7 +237,7 @@ CONFIG: { if (caller) { INCPATH: { - for my $file ( (map { "$_/$WHOAMI.pm" } @INC), $0) { + for my $file ( (map { "$_/".__PACKAGE__.".pm" } @INC), $0) { warn "Checking $file\n" if $DEBUG; if (open(POD_DIAG, $file)) { while (<POD_DIAG>) { @@ -450,7 +449,7 @@ my %msg; $transfmt{$header}{len} = length( $header ); } - print STDERR "$WHOAMI: Duplicate entry: \"$header\"\n" + print STDERR __PACKAGE__.": Duplicate entry: \"$header\"\n" if $msg{$header}; $msg{$header} = ''; @@ -538,7 +537,7 @@ sub disable { sub warn_trap { my $warning = $_[0]; - if (caller eq $WHOAMI or !splainthis($warning)) { + if (caller eq __PACKAGE__ or !splainthis($warning)) { if ($WARNTRACE) { print STDERR Carp::longmess($warning); } else { @@ -563,7 +562,9 @@ sub death_trap { } splainthis($exception) unless $in_eval; - if (caller eq $WHOAMI) { print STDERR "INTERNAL EXCEPTION: $exception"; } + if (caller eq __PACKAGE__) { + print STDERR "INTERNAL EXCEPTION: $exception"; + } &$olddie if defined $olddie and $olddie and $olddie ne \&death_trap; return if $in_eval; |