Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Warnings

by clintp (Curate)
on Feb 02, 2002 at 16:15 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 04:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found