http://www.perlmonks.org?node_id=1053903

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Enlightened Ones,

I have a memory leak on the following code (run on ActiveState Perl and Windows 7). The problem seems to be with the call to HTML::Format. After the end of the loop there still seem to be variables containing text, etc. rather than it all getting properly scoped out (and hence the memory being returned). There is an earlier node addressing a similar problem (Memory Leak? i'm clueless.), but the solution mentioned there (insert a delete command for the input file) does not seem to work for me.

I had a look at the nodes discussing memory leaks in general, but frankly did not find them that useful since they all mention tools such as Devel::Peek, Devel::Cycle... - but I cannot find a description of these tools that I as a newbie can understand.

Any help would be appreciated!
use warnings; use strict; use diagnostics; use HTML::FormatText; open INPUT, "< D:/htmladdresses.txt" or die "Problem: $!"; our @INPUT=<INPUT>; close INPUT; while (@INPUT) { my $input=shift(@INPUT); chomp $input; my $content=HTML::FormatText->format_file($input, leftmargin => 0, ri +ghtmargin => 50); # this is followed by some regular expression, all disabled now }