diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-13 21:29:15 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-13 21:29:15 +0000 |
commit | 9f1b1f2d9ab55954ee07a14c4ab04bd3dd1f99d5 (patch) | |
tree | f3e99c675e49f21e2edc6600cd4c0b10b14c41d5 /pod/perlfaq7.pod | |
parent | 828c4421567f1da54062ec5edfcc3250be409b16 (diff) | |
download | perl-9f1b1f2d9ab55954ee07a14c4ab04bd3dd1f99d5.tar.gz |
lexical warnings update for docs and tests (from Paul Marquess)
p4raw-id: //depot/perl@5712
Diffstat (limited to 'pod/perlfaq7.pod')
-rw-r--r-- | pod/perlfaq7.pod | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/pod/perlfaq7.pod b/pod/perlfaq7.pod index 0afbc0dd34..d51bf93b10 100644 --- a/pod/perlfaq7.pod +++ b/pod/perlfaq7.pod @@ -84,8 +84,17 @@ Another way is to use undef as an element on the left-hand-side: =head2 How do I temporarily block warnings? -The C<$^W> variable (documented in L<perlvar>) controls -runtime warnings for a block: +If you are running Perl 5.6.0 or better, the C<use warnings> pragma +allows fine control of what warning are produced. +See L<perllexwarn> for more details. + + { + no warnings; # temporarily turn off warnings + $a = $b + $c; # I know these might be undef + } + +If you have an older version of Perl, the C<$^W> variable (documented +in L<perlvar>) controls runtime warnings for a block: { local $^W = 0; # temporarily turn off warnings @@ -95,10 +104,6 @@ runtime warnings for a block: Note that like all the punctuation variables, you cannot currently use my() on C<$^W>, only local(). -A new C<use warnings> pragma is in the works to provide finer control -over all this. The curious should check the perl5-porters mailing list -archives for details. - =head2 What's an extension? A way of calling compiled C code from Perl. Reading L<perlxstut> @@ -168,6 +173,7 @@ own module. Make sure to change the names appropriately. package Some::Module; # assumes Some/Module.pm use strict; + use warnings; BEGIN { use Exporter (); |