in reply to Re: Error: Can't use global $^W in "my"
in thread Error: Can't use global $^W in "my"
If you want to modify the value of a built in, you must you local to do it, and then the modification will be local to the enclosing code block.
A better approach, which doesn't suffer from the problems of dynamic scoping with local, would be to use the lexically scoped (no) warnings pragma instead for this particular situation - see perllexwarn
|
|---|