Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: parsing JSON for specific entries

by suaveant (Parson)
on Aug 01, 2012 at 19:04 UTC ( #984876=note: print w/replies, xml ) Need Help??

in reply to parsing JSON for specific entries

{ denotes a hash, [ denotes array, just like in Perl. You are trying to iterate through $object->{Content_ID} by dereferencing it as an ARRAY but it is a hash, with keys CNBP_021687, CNBP_021688 and CNBP_021691. The correct way to iterate would be:
foreach $key (keys %{$object->{Content_ID}} ){ my $item = $object->{Content_ID}{$key}; print " do nothing \n"; };

                - Ant
                - Some of my best work - (1 2 3)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984876]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2016-10-24 11:50 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (305 votes). Check out past polls.