Re: Imposing a timeout on the <> operator - is this possible?

From: JSM (jsm_news_at_yahoo.com)
Date: 03/05/04


Date: 5 Mar 2004 12:03:36 -0800

megapode@hotmail.com (Bob Dubery) wrote in message news:<e8f67309.0403050032.56b21ea8@posting.google.com>...

> OK... a wierd situation and not a common one, but I want to improve
> the code. Specificially when I invoke <> I'd like to be able to impose
> a time out so that if I get nothing back after n seconds I can raise
> an error condition and start interrogating the next site.
>

You can use alarm to do this. There is an example in the Perl Cookbook (16.21).