in reply to timers in perl

There are some ways of doing this. One is the use of SIGALRM, but you need to be quite careful when using signals. Another way is to use threads; one thread could sleep, and set the variable after the specified time. Or you could use some event driven programming technique, for instance based on POE, Tk or Event.

Alternatively, you can tie the variable, and let the FETCH method check wether the allocated time has elapsed.

Abigail

Replies are listed 'Best First'.
Re: Re: timers in perl
by chame1e0n (Initiate) on Jan 15, 2003 at 10:10 UTC
    Ahh the SIGALARM did it. I'll definetly look into those other methods though. Thanks a million, both of ya :)