note
LanX
Hi<P>
first, you don't need to intialize an array, perl does the allocation automatically when you do the push.
<c>
#if (! exists $cTable{$cID}{raw}) {
# $cTable{$cID}{raw}=[];
#}
push @{$Table{$cID}{raw}}, $currentVal;
</c><P>
<i>
> and, periodically wanting to delete the hash.
<c>
delete $cTable{$cID}</c>
> My question is, do I first need to do something to remove the array or is that cleaned up automatically for me?
</i><P>
depends, garbage collections cleans up variables with an empty reference count.<P>
so as long as you don't have any <c>$copies = $Table{$cID}</c> somewhere else in the code the hash will be automatically destroyed when deleting the last reference.<P>
The same for all nested substructures/elements like the array <c>$Table{$cID}{raw}</c>, if there are no other references they will be destroyed, too.<P>
in other words: no reference left <=> no memory used <P>
for details see: [doc://perlref]
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-708738">
<p>Cheers Rolf
</div></div>
1010583
1010583