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.
In reply to Re: Warnings
by clintp
in thread Trouble temporarily disabling warnings (was: Warnings)
by vek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |