in reply to Re: Re: cleaning up memory after closing files on MACOSX
in thread cleaning up memory after closing files on MACOSX
Glad you found a solution to your problem!
As far as the memory leak, how big is @array? Does a loop like this leak memory?
foreach my $i (0..$#array) { open(FH,"> temp$i") or die "open: $!"; print FH $array[$i]; close FH; }
A few other random comments:
for my $line (@array){
If you are doing something you don't realize, like causing a memory leak, this will often tell you. It's also clearer that a memory leak isn't happening when it will disappear immediately after the loop.
|
|---|