This manual page is for Mac OS X version 10.6.3

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



warnings(3pm)                         Perl Programmers Reference Guide                         warnings(3pm)



NAME
       warnings - Perl pragma to control optional warnings

SYNOPSIS
           use warnings;
           no warnings;

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

           use warnings::register;
           if (warnings::enabled()) {
               warnings::warn("some warning");
           }

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

           if (warnings::enabled($object)) {
               warnings::warn($object, "some warning");
           }

           warnings::warnif("some warning");
           warnings::warnif("void", "some warning");
           warnings::warnif($object, "some warning");

DESCRIPTION
       The "warnings" pragma is a replacement for the command line flag "-w", but the pragma is limited to
       the enclosing block, while the flag is global.  See perllexwarn for more information.

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

       A number of functions are provided to assist module authors.

       use warnings::register
           Creates a new warnings category with the same name as the package where the call to the pragma is
           used.

       warnings::enabled()
           Use the warnings category with the same name as the current package.

           Return TRUE if that warnings category is enabled in the calling module.  Otherwise returns FALSE.

       warnings::enabled($category)
           Return TRUE if the warnings category, $category, is enabled in the calling module.  Otherwise
           returns FALSE.

       warnings::enabled($object)
           Use the name of the class for the object reference, $object, as the warnings category.

           Return TRUE if that warnings category is enabled in the first scope where the object is used.
           Otherwise returns FALSE.

       warnings::warn($message)
           Print $message to STDERR.

           Use the warnings category with the same name as the current package.

           If that warnings category has been set to "FATAL" in the calling module then die. Otherwise
           return.

       warnings::warn($category, $message)
           Print $message to STDERR.

           If the warnings category, $category, has been set to "FATAL" in the calling module then die. Oth-erwise Otherwise
           erwise return.

       warnings::warn($object, $message)
           Print $message to STDERR.

           Use the name of the class for the object reference, $object, as the warnings category.

           If that warnings category has been set to "FATAL" in the scope where $object is first used then
           die. Otherwise return.

       warnings::warnif($message)
           Equivalent to:

               if (warnings::enabled())
                 { warnings::warn($message) }

       warnings::warnif($category, $message)
           Equivalent to:

               if (warnings::enabled($category))
                 { warnings::warn($category, $message) }

       warnings::warnif($object, $message)
           Equivalent to:

               if (warnings::enabled($object))
                 { warnings::warn($object, $message) }

       See "Pragmatic Modules" in perlmodlib and perllexwarn.



perl v5.8.9                                      2001-09-21                                    warnings(3pm)

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation to the Perl project. (See perlbug(1) for submission instructions.)
Bug reports
Report bugs in the functionality of the described tool or API to Apple through Bug Reporter and to the Perl project using perlbug(1).
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.

Did this document help you? Yes It's good, but... Not helpful...