I am trying to edit a xml file using XML::Twig, but perl always crashes on outputting the xml to a new file. Now, this already happens when I don't do anything to the file, just parse it and print it to another file. I've traced the problem to the cleanup routine in XML::Twig using the Devel::ptkdb debugger, it happens somewhere in the vicinity of line 7535 in Twig.pm (I use the newest version 3.39 of XML::Twig, and strawberry perl 5.12.3).
Sometimes there's also a memory leak and I get a message "Out of memory!". The crash itself doesn't produce any error messages in perl, aside from the message in Windows 7 that perl.exe has crashed.
The xml file can be found here: http://dl.dropbox.com/u/14595053/test.zip (45 kb, 1.7 MB expanded). I have zipped it and uploaded it to dropbox because it's quite big. I have validated it with several tools and all say, that it's a valid xml file.
Does anybody know, what's going on? Thanks!use strict; use warnings; use XML::Twig; my $xml = new XML::Twig(); $xml->parsefile('test.xml'); open OUT, ">", "test.new.xml"; $xml->print(\*OUT); close OUT;
Edit: The workaround I found is to downgrade to perl 5.10.1.5.
In reply to perl crashes when processing xml with XML::Twig by justibus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |