My new name and the joys of XML::Simple

petdance on 2003-03-18T15:15:09

I've changed my use.perl.org name to "Andy HASH(0x865e440) Lester". Read gnat's journal entry to find out why.

I'm amused that Nat got bitten by the same type of bug that bit me a few years ago the first time I had to use XML::Simple. In my case, I was parsing invoices, and getting back an arrayref of lines. Problem was, a week after we went live, I got an invoice with only one line item, and XML::Simple handed back a scalar for the line. I had to modify the XML::Simple constructor to always pass back an array for <Invoice> and <LineItem> tags. my $xs = new XML::Simple( forcearray=>['Invoice','LineItem'] ); # We always want an array of Invoice and LineItem records, even if there's only one. This cautionary tale is one I always tell to anyone using XML::Simple...