Timer/alarm clock module

I

Ignoramus27279

Is there some perl module for setting alarms? The use I have in mind
is as follows:

my $times = new AlarmModule( 600, sub { print "Hello" } );

that would make the timer wake up every 600 seconds and print hello.

Any suggestions?

i
 
T

Tassilo v. Parseval

Also sprach Ignoramus27279:
Is there some perl module for setting alarms? The use I have in mind
is as follows:

my $times = new AlarmModule( 600, sub { print "Hello" } );

that would make the timer wake up every 600 seconds and print hello.

Any suggestions?

You could use Event::Lib although it might be a bit oversized for that
kind of task:

use Event::Lib;

$| = 1;

my $timer = timer_new(
sub {
my $event = shift;
print "Hello";
$event->add(600); # re-schedule
}
);
$timer->add(600);
$timer->dispatch;

Tassilo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top