|Welcome to the Monastery|
Perl Internals - references and symbol tableby nothingmuch (Priest)
|on Nov 16, 2002 at 06:45 UTC||Need Help??|
nothingmuch has asked for the
wisdom of the Perl Monks concerning the following question:
I was wondering... How does perl know where variables are in memory?
My assumption on package variables, or dynamics, is that it looks up, in the symbol table (known location is pre assumed), the reference for the name. I assume references are a structure containing a counter of refs, and a pointer. The reference's location in memory does not change until it is destroyed, and when the variable is reallocated, the reference pointer is updated.
If i'm right (the above is really but a guess), how does this work on lexical variables? A seperate symbol table? And if not, how does it work?
Thanks in advance
zz zZ Z Z #!perl