in reply to XML Parsing Out of Memory error

Like everyone else has noted, the inital entry by JackHammer into the XML::Simple doc is wrong. But the neat thing is that if he only had one QuestionList it would work. Why, you ask? Because that is what you told XML::Simple to do. If there is more than one element by the same name then you get an arrayref, otherwise you get a hash. Sounds like code breaking behaviour to me, I guess XML::Simple is broken like that. Fear not, for those lovely folks that wrote XML::Simple saw that and said: "Let there be a standardization switch in XML::Simple", and then there was. Its just not turned on in a simple Simple doc hash. As far as Perl screeching about being Out of memory!, it's better than "Core dumped" but isn't it the same sort of invalid reference problem? Perl should wretch, but it ought to leave with some parting words, IMHO. But that's for the Perl core hackers, I do well just to make things work at all. What you want is for XML::Simple to to always make the hashrefs point to an arrayref, whether there is one or more items. Instantiate your Simple doc like this and everything will be in a standardized data set.
my $xml_ref = XMLin($xml, keyattr='');
So your freshly parsed doc with a single QuestionList looks like this:
[crash@shadowfax crash]$ ./this.pl $VAR1 = { 'QuestionList' => [ { 'Question' => { 'Text' => 'Are dingos +your friend?', 'Id' => '3', 'Answer' => 'Satisfact +ory' } }, {} ] }; Satisfactory[crash@shadowfax crash]$
One of the projects I have worked on was a simple cXML system, and I am using XML::Parser::Checker and XML::Simple along with a data mapping hash to mask out the data from the documents we get in. I ran into the same problem trying to get that to work. Hope this clears things up with that.