The problem is that before I got it to work, I typo'd a "/" onto the end of the HTTP request but no error messages were generated:use strict; require LWP::UserAgent; my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout +=> 30); print "'\$ua = LWP . . . ' Errors: $@\n"; my $req = HTTP::Request->new('GET', 'http://www.somewhere.org/csc/file +.exe'); print "'\$req = HTTP . . . ' Errors: $@\n"; $req->authorization_basic('login', 'password'); print "'\$req->author . . . ' Errors: $@\n"; my $resp = $ua->request($req, '/temp/file.exe'); print "'\$resp = \$ua-> . . . ' Errors: $@\n";
The file was not downloaded either of course. So the question is what is the correct way to go about trouble shooting code like this. I want to incorporate it into a much more extensive application but I have to do more with the file after I download it.my $req = HTTP::Request->new('GET', 'http://www.somewhere.org/a/file.e +xe/');
I imagine that I could delete the file if it already existed, find in advance the size of the file to be downloaded and then verify afterwards that the file size is correct (if it exists). Is there a different module or approach that is more appropriate? Maybe reorganizing the process to an ftp'able account and using Net::Ftp?
Thanks in advance for any advice, or pointers in the right direction,
--Jim
In reply to Error checking LWP::UserAgent by jlongino
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |