- publishing free software manuals
Perl Language Reference Manual
by Larry Wall and others
Paperback (6"x9"), 724 pages
ISBN 9781906966027
RRP £29.95 ($39.95)

Sales of this book support The Perl Foundation! Get a printed copy>>>

24.5 Category Hierarchy

A hierarchy of "categories" have been defined to allow groups of warnings to be enabled/disabled in isolation.

The current hierarchy is:

all -+
     +- closure
     +- deprecated
     +- exiting
     +- glob
     +- io -----------+
     |                +- closed
     |                +- exec
     |                +- layer
     |                +- newline
     |                +- pipe
     |                +- unopened
     +- imprecision
     +- misc
     +- numeric
     +- once
     +- overflow
     +- pack
     +- portable
     +- recursion
     +- redefine
     +- regexp
     +- severe -------+
     |                +- debugging
     |                +- inplace
     |                +- internal
     |                +- malloc
     +- signal
     +- substr
     +- syntax -------+
     |                +- ambiguous
     |                +- bareword
     |                +- digit
     |                +- illegalproto
     |                +- parenthesis
     |                +- precedence
     |                +- printf
     |                +- prototype
     |                +- qw
     |                +- reserved
     |                +- semicolon
     +- taint
     +- threads
     +- uninitialized
     +- unpack
     +- untie
     +- utf8
     +- void

Just like the "strict" pragma any of these categories can be combined

use warnings qw(void redefine);
no warnings qw(io syntax untie);

Also like the "strict" pragma, if there is more than one instance of the warnings pragma in a given scope the cumulative effect is additive.

use warnings qw(void); # only "void" warnings enabled
...
use warnings qw(io);   # only "void" & "io" warnings enabled
...
no warnings qw(void);  # only "io" warnings enabled

To determine which category a specific warning has been assigned to see 25.

Note: In Perl 5.6.1, the lexical warnings category "deprecated" was a sub-category of the "syntax" category. It is now a top-level category in its own right.

ISBN 9781906966027Perl Language Reference ManualSee the print edition