oruse strict; package Strict::Package;
are almost the same, provided there are no lines between the package and the use line in the second option. (The only difference being that the package declaration itself will not be subject to strict's strictness.) But bear in mind, since the scope of the declaration is lexical, if you declare the strict in another scope, it won't apply. (That is, if you declare strict in another block, loop, eval, file, or subroutine.)package Not::Strict::Yet::Package; use strict; # Now it's a strict package
Overall, I would say that I would prefer the first one, but I don't think it makes much of a difference. The only reason why I go for the first option is that if I'm going to use strict, I like to say so right away, so I put that declaration right after the shebang. But even if you put it immediately inside the first package of the file, and then went on to define several more packages in that file, it would apply to all of the packages there, but not to the first package statement itself, if that mattered at all.{ use strict; package I::Think::I'm::Strict; } # But I'm really not
In reply to Re: order of strict and package
by needles
in thread order of strict and package
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |