I had searched with the Super Search and quite frankly I realy had no idea as to what keywords to use for this type of problem. So forgive me if this has been answered dozens of times.
I'm writing a server type program that backgrounds itself. So it will be running continuously until its killed. What I need to do is to be able to schedule a process within the server to run once every half hour or so and telling it to sleep is not an option since it needs to listen for connections. I came up with this code but as I see it its completely unacceptable since it would run over and over again for a minute. A valiant attempt, however I fell in the moat halfway over.
This attempt uses
Date::Calc's Today_and_Now
sub is_it_time {
my ($year,$month,$day, $hour,$min,$sec) = Today_and_Now();
if ($min == 29) {
return 1;
} else {
return 0;
}
}
Any ideas as to how to mimic cronlike scheduling within a perl program for running subroutines without blocking other processes?
I am at your mercy,
Brother BMaximus