develooper Front page | perl.beginners | Postings from March 2002

Re: time limit???

Thread Previous | Thread Next
From:
Jenda Krynicky
Date:
March 29, 2002 10:46
Subject:
Re: time limit???
Message ID:
3CA4C47C.3269.124D703@localhost
From: Alberto Santana <santana@qtp.ufl.edu>
> Suppose I have a Perl script (called from a crontab file) that will,
> basically, do something like this: 
> 
> $out=`lynx -dump http://lists.cpan.org/showlist.cgi?name=beginners`;
> open(OUT,">out"); print OUT $out; close(OUT); $send_it=`mail
> me\@here.com<out`; 
> 
> OK, here comes the problem. What if the web page is down? lynx will
> keep trying for a while until it gives up or something. Is it possible
> to impose a time limit, like: execute $out, wait for 45 seconds, if
> there was no response (lynx did not dump), exit(0); 

Not sure if it'll help you with the real problem you have, but in this 
case I would recoment using LWP::UserAgent (or LWP::Simple) 
instead of runing an external program.

Jenda

=========== Jenda@Krynicky.cz == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
					--- me

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About