#!/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; #### #### file: UTF-8 Unicode text, with very long lines, with no line terminators #### file: UTF-8 Unicode text, with very long lines, with no line terminators #### "\x{3a3}\x{391}\x{39b}\x{3a4}\x{3a3}\x{39c}\x{3a0}\x{39f}\x{3a5}\x{3a1}\x{393}\x{39a}"