http://qs1969.pair.com?node_id=213366

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

-nuffin
zz zZ Z Z #!perl