++ed by:

297 non-PAUSE users.

Gurusamy Sarathy


warnings - Perl pragma to control optional warnings


    use warnings;
    no warnings;

    use warnings "all";
    no warnings "all";

    if (warnings::enabled("void") {
        warnings::warn("void", "some warning");


If no import list is supplied, all possible warnings are either enabled or disabled.

Two functions are provided to assist module authors.


Returns TRUE if the warnings category in $category is enabled in the calling module. Otherwise returns FALSE.

warnings::warn($category, $message)

If the calling module has not set $category to "FATAL", print $message to STDERR. If the calling module has set $category to "FATAL", print $message STDERR then die.

See "Pragmatic Modules" in perlmod and perllexwarn.