How does use warnings affect the calling package?
The perlmodlib page says that pragmas are either package or lexical, with clues as to how to tell which is which. The docs for use warnings in particular doesn't add to that.
I can certainly see how something could modify the lexing hints variable and also manipulate the current package's symbol table.
The documentation in perlvar states that $^H does block scope things, and that is how use strict is implemented. However, use warnings uses ${^WARNING_BITS} and the description for that doesn't say anything similar re block scope restoring.
If ${^WARNING_BITS} has its value restored at the end of a block, in the same way as $^H, then the normal use warnings/no warnings would not have anything to do with the current package or any influence on the package's contents.
—John
In reply to 'use warning' and package interaction
by John M. Dlugosz
in thread order of strict and package
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |