Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi
first, you don't need to intialize an array, perl does the allocation automatically when you do the push.
> and, periodically wanting to delete the hash.
depends, garbage collections cleans up variables with an empty reference count. so as long as you don't have any $copies = $Table{$cID} somewhere else in the code the hash will be automatically destroyed when deleting the last reference. The same for all nested substructures/elements like the array $Table{$cID}{raw}, if there are no other references they will be destroyed, too. in other words: no reference left <=> no memory used for details see: perlref Cheers Rolf In reply to Re: Avoiding memory loss...
by LanX
|
|