OK, this is a very old thread, but I looked at this thread when searching for some information on a related problem, and now that I've solved it I think it should be posted here since Googling "Perl CURLOPT_RANGE" doesn't currently return any useful hits.
OK, the bottom line is that if you want to fetch a piece of a remote file using Perl you can take the WWW:Curl package
http://search.cpan.org/~szbalint/WWW-Curl-4.15/lib/WWW/Curl.pm
and modify the first example to include the lines
my $firstbyte = 50;
my $lastbyte = 100;
$curl->setopt(CURLOPT_RANGE,"$firstbyte-$lastbyte");
So the OP could use this technique to see whether, e.g. he's able to successfully fetch the 1,000,000th byte of a remote file. If he can fetch it, then he might decide not to try to download that file.
I hope that this info is useful to someone. |