![]() |
|
Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Help with attributes and XML::Simpleby ig (Vicar) |
on Aug 01, 2012 at 08:42 UTC ( [id://984733]=note: print w/replies, xml ) | Need Help?? |
In my experience, XML::Simple makes dealing with very simple XML simple but it makes dealing with more complex XML quite difficult. Had you spent two days learning one of the alternatives (I use XML::LibXML almost exclusively these days, but there are other very capable modules that give you good control over both parsing and generation of XML files) you could probably have solved your problem and learned a more powerful tool for future work. In summary, my suggestion is to use XML::Simple if it does what you need by default or you can tweak it in a few minutes. Otherwise, invest in learning a more general/powerful tool. Update: As an example of one way to get your hash with XML::LibXML:
gives
That's simple enough. The problem is, reading all the XML::LibXML docs (there are many) to find out how to do this isn't so simple.
In Section
Seekers of Perl Wisdom
|
|