in reply to Help!! XML::Simple with nested arrays

There is a problem with the following line:

my $data = XMLin( $xml, forcearray => 1 ) ;

Per the documentation for XML::Simple, 'forcearray' should be spelled 'ForceArray'. This doesn't seem to be a problem for your script, but could potentially be a problem down the road.


Dave

Replies are listed 'Best First'.
Case-sensitivity of ForceArray in XML::Simple
by ikegami (Patriarch) on Jan 04, 2005 at 18:40 UTC
    Older versions of XML::Simple (such as the one that came with ActivePerl 5.6.1) required lowercase option names. Newer versions are case-insensitive. Using "forcearray" is backwards compatible, whereas "ForceArray" is not.

      Interesting. ...the docs simply mention ForceArray, so the documentation is basically teaching a usage that is not backward compatible. Good to know about the case insensitivity though. I didn't use XML::Simple back in the Perl 5.6.x days. Thanks for the enlightenment.


      Dave