Custom-interval timer not working: what am I missing?

[email protected] (Jeff Boes) Thu, 31 Mar 2005 16:08:38 -0500
Newsgroups perl.loop
Message-ID <[email protected]>
Given a timer set up like this:

my $x = Event->timer( cb   => \&scan_tests,
                repeat     => 1,
                hard       => 0,
                reentrant  => 0,
                desc       => 'Scan tests',
                at         => time + 5,
              );

Inside "scan_tests" I have code like this:

# Calculate number of seconds until next wakeup.
my $next = ...
printf q(Next wake-up in %d seconds, at %s), $next, scalar(localtime 
time + $next);
$x->at( $next );
$x->start;


What am I missing here? The timer runs once, and never repeats (the 
reported wake-up time is some 90 seconds in the future).

-- 
Jeff Boes                                         Vox 269-226-9550 x24
Director of Software Development                  Fax 269-349-9076

Exfacto!         Exceptional Online Content     http://www.exfacto.com
Nexcerpt         ...Extend Your Expertise...    http://www.nexcerpt.com