Desdinova has asked for the wisdom of the Perl Monks concerning the following question:
For the the first in almost a year of being here I am posting a question.. that says alot about much info is already here.. but anyway
I have a "XML like" file in this format:
What I would like to be able to do is read in the first "post" and assign the content to a hash with the elements as keys so that i can access the data like
print "City: $hash{location} \n";
Then go on to the next "post" and repeat the proccessing of the data inside it. I have looked at the man pages for XML::Parser and XML::Simple but I can't figure out how to go through one post at a time. I figure there is something simple about all this that I am just missing and would appreciate if some helpful monk could point my brain in the right direction.
Thanks
I have a "XML like" file in this format:
And so on<post> <jobnumber>1234</jobnumber> <location> somecity NJ <location> </post> <post> <jobnumber>87922</jobnumber> <location> Othercity, AK <location> </post>
What I would like to be able to do is read in the first "post" and assign the content to a hash with the elements as keys so that i can access the data like
print "City: $hash{location} \n";
Then go on to the next "post" and repeat the proccessing of the data inside it. I have looked at the man pages for XML::Parser and XML::Simple but I can't figure out how to go through one post at a time. I figure there is something simple about all this that I am just missing and would appreciate if some helpful monk could point my brain in the right direction.
Thanks
Back to
Seekers of Perl Wisdom