Hm, none of the answers so far have gone into detail pedantically enough for me tonight. Here's an gutsier explanation that is mostly true.
It depends on whether that's a global variable or a lexical variable. Perl doesn't optimize away any used variable names completely, but it does only store a single copy of lexical variable names in the appropriate lexical pad. All lexical variable accesses involve indexed lookups into the appropriate lexical value pad.
Global symbols are different, and the appropriate op in the optree keeps around the name of the symbol for a runtime lookup. That means if you refer to a global variable three times in your program, you'll have at least three more copies of its name in memory.
In reply to Re: Does the size of a variable's name affect memory?
by chromatic
in thread Does the size of a variable's name affect memory?
by nmerriweather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |