http://qs321.pair.com?node_id=1017782


in reply to How to read a file after a certain interval continuously

One of many approaches would be to do it like this:

my $interval = 60 * 5 # seconds * minutes my $run_when = time + $interval; while (1) { # ... if (time - $run_when <= 0) { do_the_stuff; $run_when = time + $interval; } }