in reply to Running in 'RealTime'

This is a small example of a "real-time" subroutine:

# calls this sub each 3 seconds... local $SIG{ALRM} = sub { print "alarm "; alarm 3; }; $| = 1; # no output buffer alarm 3; # start subroutine timer # main program for (1..100) { print "running "; sleep 1; }