Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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?
[Discipulus]: uh uh.. scent of gods..

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2018-06-22 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (122 votes). Check out past polls.

    Notices?