Hi,

I am trying to create a very simple www client that times out after 5
seconds. I have tried the 2 examples below, but none of them are working.
They don't time out even though the target site cannot be found.
I think they time out after some more time.

I have ran them under Windows 2000 with ActivePerl 5.8.8.
Is it possible to do what I want?

Thanks.

use strict;
use LWP::UserAgent;

my $ua = LWP::UserAgent->new(-timeout => 5);

print $ua->get("http://www.presaromana.ro/";)->content;

__END__

my $req = HTTP::Request->new("GET", "http://www.presaromana.ro/";);
my $res = $ua->request($req);

print $res->content();


Teddy

Reply via email to