Zeokat has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use LWP::UserAgent; use HTTP::Request; my $ua = LWP::UserAgent->new; $ua->agent("Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)"); my $timeout = 30; my $url = 'http://localhost/log.txt'; print "Downloading log: " ,$url , "\n"; my $req = HTTP::Request->new(GET => $url); #$req->header(¿?¿?¿?¿?¿?); my $response = $ua->request($req); my $content = $response->content(); open SOURCE, '>>', 'log.txt' or die $!; print SOURCE $content;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to download a range of bytes?
by eserte (Deacon) on Dec 26, 2007 at 23:27 UTC | |
by Zeokat (Novice) on Dec 26, 2007 at 23:47 UTC | |
by Anonymous Monk on Dec 27, 2007 at 00:44 UTC |