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"; } }
In reply to Re^2: LWP error 500 timeout
by perlmonkdr
in thread LWP error 500 timeout
by perlmonkdr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |