I'm not quite sure what you _really_ mean here, but the answer to both your questions is yes.
Perl itself runs in ram, and each bit of extra program you write consumes a little bit of RAM.
If you declare something, perl will allocate some space for it. You can reduce the RAM used by your vars by undef'ing them when they're not needed, but if the variable exists, then there will be a little bit of ram used.
Perhaps i'm misunderstanding the question, or perhaps someone else can explain it a better than i. | [reply] |
When you declare a variable, it's like addressing an envelope. (Though I wonder if describing something in terms of envelopes is informative, in these days of email .... Like the other day, I explained soemthing to some younger people in terms of children learning to tie their shoelaces, and found out they grew up with velcro shoes.) When you assign a value, you fill the envelope ... that may or may not require extra space.
Check out PerlGuts Illustrated if you want to know more.
Personally, since I've managed to avoid needing to do anything with the internals, I have found that small doses of guts are best; learning is a cumulative proceess. Another way of looking at it, each time I investigate, I become convinced I don't need to know more.
--
TTTATCGGTCGTTATATAGATGTTTGCA
| [reply] |
I'm going to show you photographs of people and tell you their names. I'd like you to remember both the names and the faces. Their names are Sally, Robert, Benjamin, Arvin, and Marcus.
Though I haven't shown you the photographs yet, please keep the names in mind until I tell you you can forget them.
(Variables are names. Does that help?)
| [reply] |