#!/usr/bin/perl use LWP::Simple; # From CPAN use JSON qw( decode_json ); # From CPAN use Data::Dumper; # Perl core module use strict; # Good practice use warnings; # Good practice my $trendsurl = "http://www.somesite.com/"; my $json = get( $trendsurl ); die "Could not get $trendsurl!" unless defined $json; open my $file_write, '>', '/tmp/jsonParser'; print $file_write $json; close($file_write); open my $file_read, '<', '/tmp/jsonParser'; $json = <$file_read>; my $decoded_json = decode_json( $json ); print Dumper $decoded_json;