perlfaq7: How do I temporarily block warnings?

[email protected] (_brian_d_foy)
Newsgroups perl.perlfaq.workers,perl.documentation
Message-ID <301020040742416224%[email protected]>
* mention warning categories and perllexwarn


Index: perlfaq7.pod
===================================================================
RCS file: /cvs/public/perlfaq/perlfaq7.pod,v
retrieving revision 1.17
diff -u -d -r1.17 perlfaq7.pod
--- perlfaq7.pod        19 Oct 2004 22:53:50 -0000      1.17
+++ perlfaq7.pod        30 Oct 2004 12:41:39 -0000
@@ -97,6 +97,16 @@
        no warnings;          # temporarily turn off warnings
        $a = $b + $c;         # I know these might be undef
     }
+    
+Additionally, you can enable and disable categories of warnings.
+You turn off the categories you want to ignore and you can still
+get other categories of warnings.  See L<perllexwarn> for the
+complete details, including the category names and hierarchy.
+
+       {
+       no warnings 'uninitialized';
+       $a = $b + $c;
+       }
 
 If you have an older version of Perl, the C<$^W> variable (documented
 in L<perlvar>) controls runtime warnings for a block:

-- 
brian d foy, [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.