in reply to Re^2: Trouble Getting Deep Into a Hash from XML::Parser
in thread Trouble Getting Deep Into a Hash from XML::Simple

First, I would use ForceArray on the moreSpecific tag (if there is only one 'moreSpecific' node, it will not make an array), and you don't need the count to access all of the subnodes.
my $morelist = $content->{'soapenv:Body'}{'getKeywordVariationsRespons +e'}{'getKeywordVariationsReturn'}{'moreSpecific'}; for my $more (@$morelist) { print "$more->{text}\n"; print "$more->{advertiserCompetitionScale}\n"; print "$more->{searchVolumeScale}\n"; $more->{more} = $more->{text}; $more->{comp} = $more->{advertiserCompetitionScale}; $more->{pop} = $more->{searchVolumeScale}; }
Update: fixed, updated example.