ecuguru has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that sometimes it hangs on the get$url, and never comes backuse LWP::Simple; my $url = 'http://site.com/file.html'; print "Getting\n"; my $content = get $url; print "Done\n";
It's an occasional glitch, but hangs my perl script entirely. I believe that the problem is that the webserver that I am collecting data from might be getting powered off before all of the data is sent back to my perl script, so my perl script is hanging for MORE data after getting the starting few bytes.Getting Done Getting Hang
Will the timeout used here timeout even after getting some parts of the data, or will it only timeout if it doesn't get anything?use LWP::UserAgent; use LWP; $ident = "The Server"; # this gets logged $timeout = 5; # in seconds $ua = new LWP::UserAgent; # call the constructor $ua->agent($ident); # set the id $ua->timeout($timeout); # timeout my $req = new HTTP::Request GET => 'http://site.com';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get Timout with LWP
by tachyon (Chancellor) on Jun 21, 2004 at 00:43 UTC | |
by IlyaM (Parson) on Jun 21, 2004 at 15:54 UTC | |
by tachyon (Chancellor) on Jun 22, 2004 at 01:45 UTC | |
by tachyon (Chancellor) on Jun 22, 2004 at 02:47 UTC | |
|
Re: Get Timout with LWP
by Zaxo (Archbishop) on Jun 20, 2004 at 20:04 UTC | |
|
Re: Get Timout with LWP
by tachyon (Chancellor) on Jun 21, 2004 at 06:28 UTC |