On 8/24/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
> Paul Lalli wrote:
> > 'our', like 'my', is lexically scoped.  Its effects are terminated
> > when the innermost enclosing block ends.  So if you're using the same
> > package variable in two different blocks, you have to use 'our' in
> > each of them:
>
> 'our' is not lexically scoped; it is package scoped.  Once you declare a
> variable using 'our' you may use it anywhere in the package.  Think
> of it as an alias to the fully-qualified variable.  A variable declare via
> 'our' in one package is independent of a variable of the same name
> in another package.

Nope, it is lexically scoped.

from perldoc -f our
our associates a simple name with a package variable in the current
package for use within the current scope. When use strict 'vars'  is
in effect, our lets you use declared global variables without
qualifying them with package names, within the lexical scope of the
our declaration. In this way our differs from use vars , which is
package scoped.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to