|XP is just a number|
Diff b/w mods for plugging variables into symbol table:'use var' and 'our'by cool (Scribe)
|on May 16, 2006 at 17:03 UTC||Need Help??|
cool has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks, I am referring to the book, 'Professional Perl Progamming' by Peter Wainwright and have a doubt on page 260..
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..