Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How do I iterate through this data set?

by Corion (Pope)
on May 21, 2011 at 19:18 UTC ( #906086=note: print w/replies, xml ) Need Help??


in reply to How do I iterate through this data set?

print ref $hash->{'searchResult'}->{'item'};

will tell you that what you have is an array reference, not a hash.

To get at the array elements for the loop, use

foreach my $n (@{ $hash->{'searchResult'}->{'item'} }) { ... }

Also see References Quick Reference.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://906086]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2018-02-19 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (258 votes). Check out past polls.

    Notices?