From: "Zarabozo, Francisco \(GE, Corporate\)" <fzarab...@hotmail.com> > I'm getting the "Out of memory!" error from ActivePerl 5.10 (1003) running > on a box with Intel Core 2 Duo 2.4 Ghz with 4 GB in ram with Windows XP Pro. > > I'm using XML::Simple to parse a 120 MB XML file.
Don't. While XML::Simple is kinda nice if the XML is fairly small and simple, once it grows big you'd better reach for a different tool. The "parse the whole XML into a maze of objects"-style modules are out of question in this case, their memory footprint would be most likely even bigger So you are left with those that let you process the file in chunks. Either stream based parsers like the SAX modules and XML::Parser (IMHO, they lead to code that's hard to understand and debug), parsers that let you specify what tag encloses a digestible chunk and then give you the data of that tag+content one at a time like XML::Twig. Or a module that lets you filter the tags as they are encontered, transform the data structure as it's built and process the datastructure at whatever level(s) that's convenient like XML::Rules. HTH, Jenda ===== je...@krynicky.cz === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs