X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fsplain;h=f40c51e03084bc8d902bb5e89e67d5e5522de5b9;hb=d57fa8b6af39ea3eaa99a66e02134fdf61adb746;hp=073a456c81f83ad0ade6a9bba278d557c4f33e73;hpb=4633a7c4bad06b471d9310620b7fe8ddd158cccd;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/splain b/lib/splain index 073a456..f40c51e 100755 --- a/lib/splain +++ b/lib/splain @@ -1,6 +1,6 @@ #!/usr/local/bin/perl eval 'exec perl -S $0 ${1+"$@"}' - if $0; + if 0; use Config; $diagnostics::PODFILE= $Config{privlib} . "/pod/perldiag.pod"; @@ -406,16 +406,17 @@ sub warn_trap { if (caller eq $WHOAMI or !splainthis($warning)) { print STDERR $warning; } - &$oldwarn if $oldwarn and $oldwarn ne \&warn_trap; + &$oldwarn if defined $oldwarn and $oldwarn and $oldwarn ne \&warn_trap; }; sub death_trap { my $exception = $_[0]; splainthis($exception); if (caller eq $WHOAMI) { print STDERR "INTERNAL EXCEPTION: $exception"; } - &$olddie if defined $olddie and $olddie ne \&death_trap; + &$olddie if defined $olddie and $olddie and $olddie ne \&death_trap; $SIG{__DIE__} = $SIG{__WARN__} = ''; - confess "Uncaught exception from user code:\n\t$exception Bailing out"; + 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 # into an indirect recursion loop