At 06:56 PM 12/3/2001 -0500, Michael Bauer wrote:
>
>Hi. I'm trying to take a list of urls:
>
> www.foo.com
> www.bar.edu
> www.baz.gov
>
>and get the titles. Problem is, some of the urls don't exist. Setting
>the timeout low in User Agent from what I understand doesn't really apply
>until after a connection is made and data is being processed, so I can
>obviously wait quite a while to begin timing out for a non-existent url!
You aren't on windows, right?
How about using a $SIG{ALRM} trap?
>From perlipc
eval {
local $SIG{ALRM} = sub { die "alarm clock restart" };
alarm 10;
flock(FH, 2); # blocking write lock
alarm 0;
};
if ($@ and $@ !~ /alarm clock restart/) { die }
So instead of flock, do your LWP request.
Bill Moseley
mailto:[EMAIL PROTECTED]