Shaveta_Chawla has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I have an array carrying 10 values one of the value is:
#!/usr/bin/perl -- use strict; use warnings; use JSON; Main( @ARGV ); exit( 0 ); sub Main { my $json = <<'__JSON__'; {"res":{ "url":"http://www.abc.org/", "title":"extracting data using J +SON ", "snippet":"valuable information using JSON ", "meta":{"xy_subu +rl":"/abstract/123.htm","xy_keywords":" JSON","hj_year":"2009" }}} __JSON__ my $perl_scalar = JSON->new->decode($json); print JSON->new->utf8(1)->pretty(1)->encode($perl_scalar); print $perl_scalar->{res}{title}, "\n"; } __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting data using JSON
by roboticus (Chancellor) on Dec 08, 2011 at 11:23 UTC | |
|
Re: Extracting data using JSON
by Corion (Patriarch) on Dec 08, 2011 at 09:58 UTC |