in reply to XML::Parser Help!

I'm assuming you're using XML::Simple. Look at the ForceArray option so that you done have to check whether a node gets turned into an arrayref or hashref. It might be easier to just use XML::LibXML directly if the document is not too large, or XML::Twig or XML::Rules if it is large.

That being said, what you have left is a hashref, so you need to dereference it further to get your desired results. You can use Data::Dumper to see what further dereferencing needs to be done on the variable. If you had actual runnable sample code, this would be easier to debug.

Replies are listed 'Best First'.
Re^2: XML::Parser Help!
by rovf (Priest) on May 07, 2010 at 07:29 UTC
    I'm assuming you're using XML::Simple.
    Unlikely, because the subject line refers to XML::Parser. But otherwise, your suggestions - in particular the idea to use Data::Dumper, are of course correct.

    -- 
    Ronald Fischer <ynnor@mm.st>

      XML::Parser itself would not produce a data structure similar to the one accessed in the code example. Even though it can produce a data structure out of the XML, it would look very different.

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.