[EMAIL PROTECTED] wrote:
> I see. Thanks Shawn. Since we are at it, would you mind explaining a little 
> bit
> about the significance of "our" keyword. I have never understood it properly.
> Most books that I referred to say that it's a "lexically-scoped global
> variable". What does that mean? I understand global variables to be the ones
> which are accessible to all perl program units (modules, packages or scripts).
> But then, what is so lexically-scoped about it? What do the perl compiler and
> opcode interpreter do when encounter a variable name prefixed by "our"? 
> 
> I do not mean to ask you so many questions at once. It is just to prove how
> confused I am about this keyword!
> 
> Thanks.
> 
> Vishal
>  
> 

perldoc -f our
perldoc vars

Those should help. I think the key line is:

"The "our" declaration has no semantic effect unless "use strict vars"
is in effect, in which case it lets you use the declared global variable
without qualifying it with a package name."

Additionally:

http://perl.plover.com/FAQs/Namespaces.html

In the above a variable tagged with 'our' is a Package Variable.

HTH,

http://danconia.org

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


Reply via email to