Since you say that you are getting the data from an online source, you might consider the Mojolicious tool suite. In that way you can get the data, parse it and maybe even use JSON pointers to extract info.
Basic:
#!/usr/bin/env perl
use strict;
use warnings;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
my $data = $ua->get('http://openlibrary.org/search.json?title=perl%20modules')
->res
->json;
With url constructor and JSON pointer:
#!/usr/bin/env perl
use strict;
use warnings;
use v5.10;
use Mojo::URL;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
my $url = Mojo::URL->new('http://openlibrary.org/search.json')
->query( title => 'perl modules' );
say $ua->get($url)
->res
->json('/docs/0/title_suggest');
Note that the json
method on the response object either returns the whole parsed data structure or can take a pointer string (as in the second example) to return just a subset to get you going quickly. Enjoy.