nishanth_ev has asked for the wisdom of the Perl Monks concerning the following question:

Hello,
Can anyone help me out with an xml tweak ?
In my perl script at a particular point i get a return value from an inbuilt function which is a reference.
It is actually an xml data referemce. any idea how i can extract the values from this reference variable?
The variable is $xml
This is what i attempted but in vain :(
foreach my $key (keys %$xml) { my $inha = $xml->{$key}; print " $key => $xml->{$key}"; my $prophash = $xml->{$key}{'Properties'}; foreach my $k (%$prophash) { print "$k => $prophash->{$k}"; } }
I want to get all the values from the xml reference variable.. Please help...

Replies are listed 'Best First'.
Re: XML Data Extraction
by dorward (Curate) on Jun 28, 2006 at 11:21 UTC

    An XML data reference? What is this? Have you got a module which is returning some form of Perl data structure? Have you got an object with a bunch of methods for accessing an XML data structure?

    What output do you get? What errors do you get? What output do you expect to get?

    Running Data::Dumper over $xml should give you some idea about what its structure is.

      Yes Data::Dumper did the trick.. Thanks a lot for all of you..