I get it!
Perl uses a simple counting-stack mechanism for scope retention. Which explains, if mechanically inclined, your preference for "..so long as there is something that refers to the variable, Perl keeps it around..".
My own memory faculty is far too degenerated to keep such a count and so opt instead to identify the "seed" (count-1) whose lifespan dictates over its dependents (ie FORCES accessibility/life). It wouldn't be the first time this largely 'hands off' approach has landed me in trouble and, if it is not too late, already have an immensely richer appreciation of the wider underlying schema.
In reply to Re^7: modular file scoping
by Pstack
in thread modular file scoping
by Pstack
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |