in reply to Reading XML File Hash in text
You might want to try using the ForceArray => 1 option in XML::Simple. That solved my problem when I was sometimes getting a hash reference but sometimes not. (I'm not sure entirely how it handles blank fields, however.)