in reply to (tye)Re: order of strict and package
in thread order of strict and package

tye wrote, “use warnings, on the other hand, (in part) affects the calling package and so needs to come after the package statement.”

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

Replies are listed 'Best First'.
(tye)Re: 'use warning' and package interaction
by tye (Sage) on Jun 01, 2001 at 23:56 UTC

    A simple use warnings; doesn't but more advanced usages of that module do. Sorry, I was misleading.

            - tye (but my friends call me "Tye")
      I found the calling package was a default for registring a category, but could not find anything that affects the calling package. Can you be more specific?