cool has asked for the wisdom of the Perl Monks concerning the following question:
for the explanation of use var, it says..
Varivables declared with use vars are plugged into the symbol table for the current package at compile time, because use takes effect at compile time
and then in next page the explanation for our goes like...
..our works like use cars inthat it adds a new entry to the symbol table for the current package. However, unlike use vars it does this at compile time, not run time. This means that the cariable can be accessed without a package prefix from any package , butt only so long as its lexical scope exists. THis means that a package variable, declared with our at the top of the file, is global throughout the file even if it contains more than one package, just as we would normally expect a global vaiable to be.
Can any one help me to understand
1)about the diff in reading at compile time and run time. Mean to say, how this is making diff to the symbol table..
2)Ain't above two are saying same thing as that these are plugged at compile time only..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Diff b/w mods for plugging variables into symbol table:'use var' and 'our'
by NetWallah (Canon) on May 16, 2006 at 17:40 UTC | |
|
Re: Diff b/w mods for plugging variables into symbol table:'use var' and 'our'
by blazar (Canon) on May 17, 2006 at 10:35 UTC |