On Sat, 08 Dec 2012 21:15:19 +0200, Meir wrote:
> The problem is that when I am using ua, it hangs too, forever, and never
> times-out! A ^C is then required to abort it.
What did you set ->timeout() on your LWP::UserAgent object to?
,----[ perldoc LWP::UserAgent ]
| NAME
| LWP::UserAgent - Web user agent class
|
| SYNOPSIS
| require LWP::UserAgent;
|
| my $ua = LWP::UserAgent->new;
| $ua->timeout(10);
| $ua->env_proxy;
|
| my $response = $ua->get('http://search.cpan.org/');
|
| [...]
|
| $ua->timeout
| $ua->timeout( $secs )
| Get/set the timeout value in seconds. The default timeout() value
| is 180 seconds, i.e. 3 minutes.
|
| The requests is aborted if no activity on the connection to the
| server is observed for "timeout" seconds. This means that the time
| it takes for the complete transaction and the request() method to
| actually return might be longer.
`----
How long did you wait? I just tried your script, where I added:
$mech->timeout(10);
after the line where you create your WWW::Mechanize object, and I got a
time out after 10 seconds.
Best regards,
Adam
--
"And so, after a three minute downpour, he became Adam Sjøgren
ludicrously attired for the rest of the day." [email protected]