X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperllexwarn.pod;h=12ce1f6c82ece36aa5f7e2d8f5bc97e343163918;hb=10ac92784f49d4a1fe54cc1ed7d05f0d3b2a2f29;hp=7b3ce3ce20bce5a01ae6463089d0dfd663bd82e5;hpb=388759296cc69a19099065bacd8fc616910d1c3d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perllexwarn.pod b/pod/perllexwarn.pod index 7b3ce3c..12ce1f6 100644 --- a/pod/perllexwarn.pod +++ b/pod/perllexwarn.pod @@ -207,6 +207,8 @@ The current hierarchy is: all -+ | + +- assertions + | +- closure | +- deprecated @@ -351,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 @@ -374,9 +383,9 @@ Consider the module C below. sub open { my $path = shift ; if ($path !~ m#^/#) { - warnings::warn("changing relative path to /tmp/") + warnings::warn("changing relative path to /var/abc") if warnings::enabled(); - $path = "/tmp/$path" ; + $path = "/var/abc/$path"; } }