use strict; use LWP::UserAgent; use HTTP::Request; use utf8; my ($content,$decoded,$req,$res); my $url = "http://something"; my $ua = LWP::UserAgent->new; $req = HTTP::Request->new("GET", $url); $req->header('Content-Type' => 'application/json', 'Accept' => 'application/json, text/javascript, */*; q=0.01' ); $res = $ua->request($req); $content = $res->content(); # First request done # New url $url = "http://something_else"; # What next?