You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by James Ratcliff <fa...@yahoo.com> on 2002/02/15 20:33:03 UTC

Perl help with timeout in LWP

I need some help on a simple timout issue...

I looked online and all I could find is some over-my-head socket
issues, so maybe you can help...

I am useing the LWP::Simple to retrieve webpages from the net

I am having problems with loading some pages though because the page
will take forever...

Sometimes it will return with nothing, IE no page found, but sometimes
it just searches forever.

So, simply, how can I catch the ones that do not load after say a
minute, and continue the program..

Thank you,
  James Ratcliff

__________________________________________________
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail 
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


OT: Re: Perl help with timeout in LWP

Posted by ___cliff rayman___ <cl...@genwax.com>.
James Ratcliff wrote:

> I am useing the LWP::Simple to retrieve webpages from the net
>
> I am having problems with loading some pages though because the page
> will take forever...
>
> Sometimes it will return with nothing, IE no page found, but sometimes
> it just searches forever.
>
> So, simply, how can I catch the ones that do not load after say a
> minute, and continue the program..
>

use LWP::UserAgent instead, then
$ua->timeout(10);  #wait 10 seconds then we're out of here

in order to figure out how to use the more complex UserAgent try:
perldoc lwpcook
perldoc LWP::UserAgent

good luck!



--
___cliff rayman___cliff@genwax.com___http://www.genwax.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org