use strict; use warnings; use Mojo::UserAgent; use LWP::UserAgent; use HTTP::Request::Common qw(GET); use Data::Dump qw(dd); my $outputFilename = "test_output.txt"; my $fh_data; open( $fh_data, '>', $outputFilename ) or die "Could not open file '$outputFilename' $!"; my $url = "http://web.archive.org/cdx/search/cdx?url=anautismobserver.wordpress.com&output=json" ; # &limit=3 my $ua = Mojo::UserAgent->new; my $json_aoa = $ua->get($url)->res->json; # dd $json_aoa; # for debug for my $ar_jentry (@$json_aoa) { # handle each decoded JSON entry printf $fh_data "%s\t%s\t%s\t%s\t%s\t%s\t%s\n", @$ar_jentry; } close $fh_data;