Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: JSON Structure Question

by stephen (Priest)
on May 22, 2013 at 22:00 UTC ( #1034822=note: print w/replies, xml ) Need Help??


in reply to JSON Structure Question

If you want to get, say, the value of "subject1" of each sequence, the easiest way is with the values keyword, as in:

my $data = $json->decode($jsonfeed); my @values = (); foreach my $value ( values %{ $data } ) { push(@values, $value->{'subject1'}); } print Dumper( \@values );

Which returns

$VAR1 = [ 'value', 'value', 'value' ];

I'm not too clear on what values you're looking for, so I hope this helps.

stephen

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2020-05-30 19:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?