Ok, I did some reading about symbol tables, and if I understand them correctly, they are just hashes that contain the variables in your program. The keys in the hash are the variable's names and the values are the variable's values. However, the docs say that the symbol table hash does not contain "my" variables--only dynamic variables. What is a dynamic variable? Anything that isn't a my variable?
The place that I'd look for documentation on the symbol table is Symbol Tables, but I don't see any use of the term ‘dynamic variables’ there (and I wouldn't expect to see one in the Perl documentation; it's not a standard term). Did you look somewhere else?
Variables in Perl are either local *, in which case they are lexically scoped, or global, in which case they are dynamically scoped. It is global (or, better, ‘package’) variables that you will find in the stash. Lexicals are created with my, as you say; globals are created with our, or, if you are naughty and don't use strict, implicitly whenever you reference a previously un-declared variable.
UPDATE: Sorry, I was very very slow (had to go to class in the middle) and ikegami gave a (slightly more admonitory :-) ) reply first.
* Except that we call them lexicals, not locals, because they have nothing to do with the variables referenced (not created) by local.
In reply to Re^3: type glob
by JadeNB
in thread type glob
by 7stud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |