Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

How do I temporarily block warnings?

by faq_monk (Initiate)
on Oct 08, 1999 at 00:27 UTC ( #683=perlfaq nodetype: print w/replies, xml ) Need Help??

Current Perl documentation can be found at perldoc.perl.org.

Here is our local, out-dated (pre-5.6) version:

The $^W variable (documented in the perlvar manpage) controls runtime warnings for a block:

    {
        local $^W = 0;        # temporarily turn off warnings
        $a = $b + $c;         # I know these might be undef
    }

Note that like all the punctuation variables, you cannot currently use my() on $^W, only local().

A new 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (None)
    As of 2017-09-22 03:09 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      During the recent solar eclipse, I:









      Results (256 votes). Check out past polls.

      Notices?