$req->content_type('application/whatever-pdf-mimetype-is'); #### use LWP::UserAgent; $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => 'http://full-url-you-want-or-are-requesting'); # following line defines what will be saved to your machine $res = $ua->request($req, "html-filename-dot-html-part--index-dot-html-for-example"); if ($res->is_success) { print "ok\n"; } else { print $res->status_line, "\n"; }