perldiag
perl documentation file containing all diagnostic messages that Perl can produce
TLDR
View all Perl diagnostics
$ perldoc perldiag
Search for specific message$ perldoc perldiag | grep "[error message]"
Use splain for explanations$ perl [script.pl] 2>&1 | splain
Enable verbose warnings$ perl -Mdiagnostics [script.pl]
SYNOPSIS
perldoc perldiag
splain [errormessage_]
DESCRIPTION
perldiag is a Perl documentation file containing all diagnostic messages that Perl can produce. Each message includes explanation and suggested fixes.
Access via perldoc or use diagnostics module for runtime explanations.
Read full diagnostics
perldoc perldiag
Use diagnostics module in script
perl -Mdiagnostics script.pl
Explain error messages
echo "Use of uninitialized value" | splain
$
# IN SCRIPT
use diagnostics; # Verbose messages# IN SCRIPT
use warnings; # Enable warnings
Or for specific categories
use warnings qw(all);
no warnings qw(uninitialized);
$
# MESSAGE TYPES
(W) Warning - may indicate problem# MESSAGE TYPES
(D) Deprecation - feature being removed
(S) Severe warning - almost certainly wrong
(F) Fatal - compilation error
(X) Alien - error from external source
