Perl-Sensitive Sunglasses | |
PerlMonks |
Help with attributes and XML::Simpleby Smaug (Pilgrim) |
on Aug 01, 2012 at 08:08 UTC ( [id://984723]=perlquestion: print w/replies, xml ) | Need Help?? |
Smaug has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I have been battling with this for two days and I now have gone in so may circles I don't know what's left to try. I have the following XML file (This is just a small section) which is output from another system:
I have used XML::Simple and have reach the point where just to try get anything, I have reduced the code to:
At this point all is well, but what I'd like is the values in the <Vendor> tag in a hash with the vendorUniqueKey as the key and the name as the value. I've tried: Which returns a reference to the hash (I think), but I can' t seem to find a way to step through the data in the hash. When I try:
I get Can't use string ("HASH(0x31d7078)") as a HASH ref while "strict refs" in use and I get similar errors if I try a host of other ways. Clearly I'm lost and don't know where to go from here. I don't even know if the data I need is in the hash or if I've completely messed it up. Any help would be appreciated. Regards, Smaug.
Peddle faster monkeys!! I need more power!!
Back to
Seekers of Perl Wisdom
|
|