Home: Perl Programming Help: Intermediate:
XML::Simple question

New User

Aug 2, 2011, 11:15 PM

Views: 2122
XML::Simple question

Hi All, I need to read a fairly large XML file and I can not figure out how to go through the file. Simpel XML file I dont have a problem with.

print $data->{nsanity}->{dc_details}->{timestamp},"\n" ;
print $data->{nsanity}->{dc_details}- {collector_platform},"\n" ;

This makes sense, but the XML file has another section where the under the level of dc_details there ate lots of sections of "command details" and under the there is the information which command was run and the output of that command. I like to look trough these section to figure out where I find the information I need. here are the xml file and .pl of my attempts


Your help is very much apriciated. Racker


Aug 4, 2011, 6:06 PM

Views: 2095
Re: [racker79] XML::Simple question

It's probably time for you to upgrade to a more robust xml module. XML::Simple is only good for basic config files and such, after you a while you should start using XML::Twig and learning about XPath.

- Miller