in reply to Re: strict and variable scopes
in thread strict problem

An important thing to keep in mind, is that you are defining a lexical variable with my @in. This means it will only be in scope within that block, unless you use a method like flocto mentions above.

But if I call an external procedure, won't this procedure inherit the environment of it's caller - and therefor all of it's variables be within the scope of that very block?

Replies are listed 'Best First'.
Re: Re: Re: strict and variable scopes
by chromatic (Archbishop) on Mar 20, 2002 at 21:07 UTC
    Short answer: No, it won't.

    Long answer: It won't inherit lexical variables. That's the point. If you localize a global name, that change will be visible to all functions called within the scope of the change.

    That won't help you here, though, as you first need to declare a global name with the vars pragma.