LinuxCommandLibrary

perldiag

perl documentation file containing all diagnostic messages that Perl can produce

TLDR

View all Perl diagnostics

$ perldoc perldiag
copy
Search for specific message
$ perldoc perldiag | grep "[error message]"
copy
Use splain for explanations
$ perl [script.pl] 2>&1 | splain
copy
Enable verbose warnings
$ perl -Mdiagnostics [script.pl]
copy

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
copy
use diagnostics; # Verbose messages
use warnings; # Enable warnings

Or for specific categories

use warnings qw(all);
no warnings qw(uninitialized);

$
# MESSAGE TYPES
copy
(W) Warning - may indicate problem
(D) Deprecation - feature being removed
(S) Severe warning - almost certainly wrong
(F) Fatal - compilation error
(X) Alien - error from external source
$
# CAVEATS

Part of core Perl documentation. diagnostics module adds runtime overhead. Use only during development.

# HISTORY

perldiag is part of **Perl** core documentation by **Larry Wall** and the Perl community.

# SEE ALSO

perl(1), perlre(1), splain(1), perldoc(1)
copy

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community