X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperllexwarn.pod;h=9b614271bb9bc2516934f399d176dfbd8198f9e2;hb=16114dde8ca7b3eded13218a07f79301ce8c5946;hp=fd4b025ae4322bbcc085e27f5c1edbd2aef7c8d6;hpb=99ef548ba710eb2617804c989e4d5fdae1f04f37;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perllexwarn.pod b/pod/perllexwarn.pod index fd4b025..9b61427 100644 --- a/pod/perllexwarn.pod +++ b/pod/perllexwarn.pod @@ -207,6 +207,8 @@ The current hierarchy is: all -+ | + +- assertions + | +- closure | +- deprecated @@ -285,6 +287,8 @@ The current hierarchy is: | +- taint | + +- threads + | +- uninitialized | +- unpack @@ -349,13 +353,20 @@ The scope where C is used has escalated the C warnings category into a fatal error, so the program terminates immediately it encounters the warning. -To explicitly disable a "FATAL" warning you just disable the warning it is -associated with. So, for example, to disable the "void" warning in the -example above, either of these will do the trick: +To explicitly turn off a "FATAL" warning you just disable the warning +it is associated with. So, for example, to disable the "void" warning +in the example above, either of these will do the trick: no warnings qw(void); no warnings FATAL => qw(void); +If you want to downgrade a warning that has been escalated into a fatal +error back to a normal warning, you can use the "NONFATAL" keyword. For +example, the code below will promote all warnings into fatal errors, +except for those in the "syntax" category. + + use warnings FATAL => 'all', NONFATAL => 'syntax'; + =head2 Reporting Warnings from a Module The C pragma provides a number of functions that are useful for @@ -371,8 +382,9 @@ Consider the module C below. sub open { my $path = shift ; - if (warnings::enabled() && $path !~ m#^/#) { - warnings::warn("changing relative path to /tmp/"); + if ($path !~ m#^/#) { + warnings::warn("changing relative path to /tmp/") + if warnings::enabled(); $path = "/tmp/$path" ; } }