Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-09-20 12:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (159 votes), past polls