use LWP::UserAgent; my $BBOX = "-96.09299316406248+38.96034339396338%2C+-83.39279785156248+38.96034339396338%2C+-83.39279785156248+44.33256692562997%2C+-96.09299316406248+44.33256692562997%2C+-96.09299316406248+38.96034339396338"; for (1 .. 1000) { open my $fh, ">>", 'foo.txt'; my $ua = LWP::UserAgent->new; $ua->agent("MyApp/0.1 "); my $req = HTTP::Request->new(GET => "http://localhost:5001/points.json?callback=foo&BBOX=$BBOX"); my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { say $fh $res->content; } else { say $fh $res->status_line; } close $fh; }