Subject: | memory problem |
when is run this subroutine for 1000 times with the same template
only $newfile and $change_the_text differs
my program uses more and more memory until i get out of memory
what is wrong ?
seems like $doc is not flushed out of memory when i do a
$doc->save("$output_path\\$newfile.odt")
sub changeodt {
my $directory = shift @_;
my $template =shift @_;
my $output_path =shift @_;
my $newfile = shift @_;
my $change_the_text = shift @_;
$doc = ooDocument(file => "$directory\\$template");
$filter = "select_this_text";
$result = $doc->selectTextContent($filter, "$change_the_text");
$doc->save("$output_path\\$newfile.odt");
}