=head2 The C<diagnostics> Pragma
This module extends the terse diagnostics normally emitted by both the
-perl compiler and the perl interpreter, augmenting them with the more
+perl compiler and the perl interpreter (from running perl with a -w
+switch or C<use warnings>), augmenting them with the more
explicative and endearing descriptions found in L<perldiag>. Like the
other pragmata, it affects the compilation phase of your program rather
than merely the execution phase.
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
use Carp;
$Carp::Internal{__PACKAGE__.""}++;
-our $VERSION = 1.14;
+our $VERSION = 1.16;
our $DEBUG;
our $VERBOSE;
our $PRETTY;
$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;
};
# 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+/ ){