Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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)

Comment on Re: parsing JSON for specific entries
Download Code

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 taking refuge in the Monastery: (4)
As of 2015-10-10 09:58 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (255 votes), past polls