I tried globalising variables and undef , increasing data segment space in unix , localising variable , but still getting the same error. I need to process around 750 files .Can anyone help? Thanks. I know reading the entire file into string may be a problem. But I am not sure of anyother ways. But still as i declare the string as global and making it ="" . shoulnd tht release memory in next iterations ?
foreach my $file_name (@dir_contents)
{
if(-f "rawdata/$file_name")
{
$xmlres="";
eval {
while(<FILE>)
{
$xmlres.=$_;
}
close FILE;
***$doc=$parser->parsestring($xmlres);***
foreach my $node($doc->getElementsByTagName("nam1"))
{
foreach my $tnode($node->getElementsByTagName(("name2")))
{
//processing
}
}
}
} }