in reply to order of strict and package

You can put use strict above or below since (as has been said) its effect is lexically scoped. use warnings, on the other hand, (in part) affects the calling package and so needs to come after the package statement.

For this latter reason, I'd put the package before both of the others.

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
'use warning' and package interaction
by John M. Dlugosz (Monsignor) on Jun 01, 2001 at 23:49 UTC
    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

      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?