Hello,
I'm afraid I'm fairly new to Perl so apologies in advance if I'm wasting anyone's time!
I'm using XML::Bare to process a very large XML file. I am using a sub as follows:
sub get_xml_tree {
my $xml = $_[0];
my $xmlhandle = new XML::Bare(text => $xml);
return $xmlhandle->parse();
}
The $xml is actually just a small chunk of xml, extracted from the original 4Gb xml file one record at a time. So I'm executing this sub up to a million times.
The problem is, I'm getting a memory leak - $xmlhandle doesn't seem to free up the memory when it goes out of scope in the sub.
What am I doing wrong?
Many thanks!
Meriadoc.