in reply to Re: Re: VI VI VI - the number of the beast
in thread VI VI VI - the number of the beast

Well, the use strict has to be inside the package statement for the package to be using strict, but since you can define multiple packages within a single file, it's still a good idea to toss an extra use strict at line 2 or 3 (assuming that line 1 is "#!/usr/bin/perl -wT").
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
  • Comment on Re: Re: Re: VI VI VI - the number of the beast

Replies are listed 'Best First'.
Re: Re: Re: Re: VI VI VI - the number of the beast
by chipmunk (Parson) on May 06, 2001 at 08:57 UTC
    Packages don't actually use strict. strict simply takes effect until the end of the lexical scope in which it occurs (either file or block). Package declarations don't matter to the strict pragma.

    Here's an example:

    #!perl use strict; package First; $x = 1; package Second; $y = 2; __END__ Global symbol "$x" requires explicit package name at - line 7. Global symbol "$y" requires explicit package name at - line 11. Execution of - aborted due to compilation errors.