in reply to Re: LWP error 500 timeout
in thread LWP error 500 timeout
Yes, thank for your reply, but note, that this method fail after some request and using the second way not, Why?
#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; use LWP::Debug qw(+); BEGIN { close STDERR; open STDERR, '>./lwp-error.txt'; } END { close STDERR; } my $a=0; my $ua = LWP::UserAgent->new; # in some point this method fail. while (11000 > $a++) { my $res = $ua->get('http://www.perlmonks.com'); if ($res->is_success){ print $res->decoded_content; } else { print "Error: " . $res->status_line . "\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: LWP error 500 timeout
by Anonymous Monk on Feb 17, 2008 at 13:04 UTC |