|Don't ask to ask, just ask|
Parsing XML with XML::Simpleby madbombX (Hermit)
|on Dec 18, 2006 at 00:41 UTC||Need Help??|
madbombX has asked for the wisdom of the Perl Monks concerning the following question:
I have been at this for much longer than should be necessary. I am using XML::Simple, but I have also unsuccessfully tried XML::Twig. The file (with an example below) I have a file that looks like what is below. Each tag is only used once. I know it is possible to use a few regexen, but the way I need to use the data later, having the data in a hash similar to one returned by XML::Simple.
When I have the above text, all I get is what's inside of <CVS>. When I add <XML> tags surrounding the whole file, all I get is the following using Data::Dumper:
What is the best method to extract the data out of this file (either using an XML module or not) and pulling out what I need into a hash? Thanks.
Update: I forgot to include the code I actually tried. I know the $file is correct and @articles is populated.
Update 2: I think I need to provide a better example of the data. So look above at the data example and that gives a much better perception of what I am dealing with.