#! perl -slw use strict; use threads; use threads::shared; my $quit :shared = 0; $SIG{INT} = sub { print 'SIGINT'; $quit = 1; }; async { while( not $quit ) { my $wakeup = time() + 60 * 60; print( $quit ), sleep 1 while not $quit and time() < $wakeup; ## Do the hourly task; } }->detach; sleep 1 while not $quit; __END__ c:\test>junk60 0 0 SIGINT