Gossamer Forum
Home : General : Perl Programming :

Does this work??

Quote Reply
Does this work??
Does this code work??
-------------------
use LWP::Simple;

my $url = "$line";

local $SIG{ALRM} = \&died;
alarm 10;
my $results = get ($url);
alarm 0;
-------------------
Quote Reply
Re: Does this work?? In reply to
Not as is no, there is no subroutine &died that should be called if it takes longer then 10 seconds.

You might want to investigate LWP::UserAgent as I think you can specify a timeout variable.

Cheers,

Alex
Quote Reply
Re: Does this work?? In reply to
What is LWP::UserAgent ?
Would you mind to explain more clearly?
Quote Reply
Re: Does this work?? In reply to
UserAgent.pm file on your server or on your computer if you have ActiveState installed.

------------------
find.virtualave.net