in reply to Memory reusability

It depends upon the version and platform of Perl.

Under Windows, perl can and does release some memory back to the OS when it is done with it, as demonstrated below:

c:\test>p1 Name "Data::Dump::MAX_WIDTH" used only once: possible typo at C:\Perl6 +4\bin\p1.p [0] Perl> system qq[ tasklist /fi "pid eq $$"];; Image Name PID Session Name Session# Mem + Usage ========================= ======== ================ =========== ====== +====== perl.exe 5600 Console 1 9 +,972 K [0] Perl> $big = 'x' x 10e6;; [0] Perl> system qq[ tasklist /fi "pid eq $$"];; Image Name PID Session Name Session# Mem + Usage ========================= ======== ================ =========== ====== +====== perl.exe 5600 Console 1 19 +,764 K [0] Perl> undef $big;; [0] Perl> system qq[ tasklist /fi "pid eq $$"];; Image Name PID Session Name Session# Mem + Usage ========================= ======== ================ =========== ====== +====== perl.exe 5600 Console 1 9 +,976 K

And I've heard tell, but cannot verify that under some circumstances, Perl will do the same on some other platforms. YMMV.

But in the end, it is irrelevant, and your trainers should be taken to task for even mentioning it at your stage of learning.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP PCW It is as I've been saying!(Audio until 20090817)