you need to be careful when talking about events in perl. Events are a term coined for OOP program, which perl is not really made for. It's possible, sure, with things such as POE and the Tk Modules, but namely for standard perl programming, it's pretty much not event driven. My suggestion here, is to do an infinate loop, something really easy like:
while (1) {
# /* Stuff To Do In Loop Here */
}
Then grab a time stamp. You can use the epoch, I believe, with time. So you can take a time stamp, set a variable to contain the old time, plus however many seconds you want the "timer" to be, and then test it against the new time, so something like:
$oldtime = (time + 10);
while (1) {
if (time > $oldtime) {
&sub_to_call;
$oldtime = (time + 10);
}
}
The above code will take a timestamp, and add 10 seconds to it. Then it will go into an infinate loop, and keep checking if the current time is greater than the time we specified. If it is, so either 10 or 11 seconds have passed, we call a sub called "sub_to_call", and then we reset our oldtime variable to now, plus 10 more seconds. Basically, every 10 seconds this program should call the sub.