The perlio warnings are not mandatory.
[p5sagit/p5-mst-13.2.git] / pod / perllexwarn.pod
index b98e333..7b3ce3c 100644 (file)
@@ -207,10 +207,10 @@ The current hierarchy is:
 
   all -+
        |
-       +- chmod
-       |
        +- closure
        |
+       +- deprecated
+       |
        +- exiting
        |
        +- glob
@@ -221,6 +221,8 @@ The current hierarchy is:
        |                |
        |                +- exec
        |                |
+       |                +- layer
+       |                |
        |                +- newline
        |                |
        |                +- pipe
@@ -265,8 +267,6 @@ The current hierarchy is:
        |                |
        |                +- bareword
        |                |
-       |                +- deprecated
-       |                |
        |                +- digit
        |                |
        |                +- parenthesis
@@ -285,7 +285,7 @@ The current hierarchy is:
        |
        +- taint
        |
-       +- umask
+       +- threads
        |
        +- uninitialized
        |
@@ -316,6 +316,11 @@ C<warnings> pragma in a given scope the cumulative effect is additive.
 To determine which category a specific warning has been assigned to see
 L<perldiag>.
 
+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.
+
+
 =head2 Fatal Warnings
 
 The presence of the word "FATAL" in the category list will escalate any
@@ -325,16 +330,16 @@ and C<join> can all produce a C<"Useless use of xxx in void context">
 warning.
 
     use warnings ;
+
     time ;
+
     {
         use warnings FATAL => qw(void) ;
         length "abc" ;
     }
+
     join "", 1,2,3 ;
+
     print "done\n" ;     
 
 When run it produces this output
@@ -346,6 +351,12 @@ The scope where C<length> is used has escalated the C<void> 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:
+
+    no warnings qw(void);
+    no warnings FATAL => qw(void);
 
 =head2 Reporting Warnings from a Module
 
@@ -362,8 +373,9 @@ Consider the module C<MyMod::Abc> 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" ; 
         }
     }