in reply to simple use of Net::HTTP

From the synopsis
use Net::HTTP; my $s = Net::HTTP->new(Host => "www.perl.com") || die $@; $s->write_request(GET => "/", 'User-Agent' => "Mozilla/5.0"); my($code, $mess, %h) = $s->read_response_headers; while (1) { my $buf; my $n = $s->read_entity_body($buf, 1024); die "read failed: $!" unless defined $n; last unless $n; print $buf; }
That read_entity_body part is what actually reads the file content.

I think its a better idea if you use WWW::Mechanize, its a higher level interface

use WWW::Mechanize; my $ua=WWW::Mechanize->new(); $ua->get($url); $ua->save_content('filename.html') if $ua->success();