If your not using Active State Perl, take a look at pelrfunc:alarm function.
If you are using AS then you'll need to fork and use sleep in the child process and then the waitpid or similar methods to acheive this. A super search for "alarm Win32" should get you several hits where this has been discussed before.
Examine what is said, not who speaks.
The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.
| [reply] |
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 | [reply] |
Ahh the SIGALARM did it. I'll definetly look into those other methods though. Thanks a million, both of ya :)
| [reply] |
Might be overkill but you could always take a peek at Time::HiRes.
--
vek
-- | [reply] |