Accessing attributes in XML::Simpleby sherab (Scribe)
|on Dec 31, 2009 at 19:34 UTC||Need Help??|
sherab has asked for the
wisdom of the Perl Monks concerning the following question:
Hi folks, I am having an issue parsing XML using Perl's XML::Simple. The XML file I am parsing is below.... (It's called cars.xml)
Using Data::Dumper on this yields....
The script I am using is below....
Running code yields this....
Not an ARRAY reference at ./node_test2.pl line 15
What I like about the above is that referencing model and mileage info is easy using the foreach routine above. What I need to do is to equally access the attributes of "id" and "content" in an equally simple way. Of course I may just need to use something else besides XML::Simple too but I thought I'd see if the monks had any ideas.