=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
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>
package Some::Module; # assumes Some/Module.pm
use strict;
+ use warnings;
BEGIN {
use Exporter ();
If you want to override a predefined function, such as open(),
then you'll have to import the new definition from a different
-module. See L<perlsub/"Overriding Builtin Functions">. There's
+module. See L<perlsub/"Overriding Built-in Functions">. There's
also an example in L<perltoot/"Class::Template">.
If you want to overload a Perl operator, such as C<+> or C<**>,