in reply to XML::LibXML out of memory

me too i'd go with XML::Twig

the modules has his own site full of examples: in your specific situation you can profit of the flush or purge XML::Twig methods to free the momeory hold by the Twig til now (they are described in section 4.3 of the XML::Twig tutorial).

See Processing_an_XML_document_chunk_by_chunk(saving memory) and also the Twig quick reference as side read to official CPAN documentation.

Anyway i'm sorry for your 500 Mb of XML.. ;=)

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.