This module also adds a stack trace to the error message when perl dies.
This is useful for pinpointing what caused the death. The B<-traceonly> (or
-just B<-t>) flag turns off the explantions of warning messages leaving just
+just B<-t>) flag turns off the explanations of warning messages leaving just
the stack traces. So if your script is dieing, run it again with
perl -Mdiagnostics=-traceonly my_bad_script
=cut
use strict;
-use 5.006;
+use 5.009001;
use Carp;
$Carp::Internal{__PACKAGE__.""}++;
-our $VERSION = 1.14;
+our $VERSION = 1.17;
our $DEBUG;
our $VERBOSE;
our $PRETTY;
my $WHOAMI = ref bless []; # nobody's business, prolly not even mine
local $| = 1;
-local $_;
+my $_;
my $standalone;
my(%HTML_2_Troff, %HTML_2_Latin_1, %HTML_2_ASCII_7);
{
print STDERR "FINISHING COMPILATION for $_\n" if $DEBUG;
local $/ = '';
- local $_;
my $header;
my $for_item;
while (<POD_DIAG>) {
$toks[$i] = '[\da-f]+';
}
} elsif( length( $toks[$i] ) ){
- $toks[$i] =~ s/^.*$/\Q$&\E/;
+ $toks[$i] = quotemeta $toks[$i];
$conlen += length( $toks[$i] );
}
}
$PRETTY++;
next;
};
-
- /^-t(race)?$/ && do {
+ # matches trace and traceonly for legacy doc mixup reasons
+ /^-t(race(only)?)?$/ && do {
$TRACEONLY++;
next;
};
- /^-w(arntrace)?$/ && do {
+ /^-w(arntrace)?$/ && do {
$WARNTRACE++;
next;
};
my $wantspace;
sub splainthis {
return 0 if $TRACEONLY;
- local $_ = shift;
+ $_ = shift;
local $\;
+ local $!;
### &finish_compilation unless %msg;
s/\.?\n+$//;
my $orig = $_;
# but be aware of messsages containing " at this-or-that"
my $real = 0;
my @secs = split( / at / );
+ return unless @secs;
$_ = $secs[0];
for my $i ( 1..$#secs ){
if( $secs[$i] =~ /.+? (?:line|chunk) \d+/ ){