Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Warnings

by clintp (Curate)
on Feb 02, 2002 at 16:15 UTC ( #142932=note: print w/ replies, xml ) Need Help??


in reply to Trouble temporarily disabling warnings (was: Warnings)

Another difference is that $^W=0 is temporal (or dynamic) and use warnings is lexical (scope limited).

Setting $^W=0 causes the remainder of the subroutine and any subroutines called thereafter to not throw warnings at runtime. The warnings stay off until you restore $^W.

use warnings works like other lexically scoped pragmas: it only affects things within the block it appears. If you step outside of that block (say, during a subroutine call) the warnings go back to the state they were in before entering the block. When you return to the block, they're back in effect.


Comment on Re: Warnings

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://142932]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2015-07-06 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (84 votes), past polls