This would be the rough pseudocode (a very rudimentary one).
$SIG{ALRM} = sub { exec (self) };

alarm (2 mins);
do stuff;


There is a race between the alarm and do stuff. How it would affect your
program, you can judge better
/kk


On Thu, Nov 29, 2001 at 08:25:58AM -0500, Bob Showalter wrote:
> > -----Original Message-----
> > From: nafiseh saberi [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, November 29, 2001 2:44 AM
> > To: [EMAIL PROTECTED]
> > Subject: PERL instead of crontab 
> > 
> > 
> > hi all.
> > I wish ,all of you be hopefull and happy.
> > 
> > I write one program for control user in ISP 
> > (internet service provider)
> > with crontab.
> > it runs every 2 minutes and finish and
> > 2 minutes later , run again ....
> > 
> > in your mind..
> > how can I write it with perl ??
> 
> How about just:
> 
>    while(1) {
>       do_stuff();
>       sleep(120);     # wait 2 minutes
>    }
> 
> If you really want the process to terminate and be restarted, well,
> that's what cron is for. Maybe I don't understand the problem...
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to