http://www.perlmonks.org?node_id=1056599


in reply to Re^3: Reading XML LibXML
in thread Reading XML LibXML

...which dies horribly when there is only one <Entry>-element, e.g. the following XML:

<table> <Entry No="1"> <lastname_>Dasd</lastname_> <firstname_>Dasd</firstname_> <street_>Dasd</street_> <houseno_>12</houseno_> <zip_>1231</zip_> <city_>Dasd</city_> <sex_>maennlich</sex_> <marital_>geschieden</marital_> <character_>Brille Sommersprossen</character_> <description_>asdas </description_> </Entry> </table>

Which prooves what Anonymous monk said before... ;)

McA

Replies are listed 'Best First'.
Re^5: Reading XML LibXML
by hdb (Monsignor) on Oct 02, 2013 at 11:11 UTC

    True, but why would you write a script for a single record? ;)

      Probably a script fetching external xml-files, where you get 0-n <Entry>-tags in each file... ;)

        I agree with the statement about the limitations of XML::Simple. I like it a lot as it can solve simple problems with three lines of code, and I find it acceptable to use the one or other option as well (say ForceArray), but once you reach that point, a more powerful module is usually required.