while (1) { while () { # do something here } sleep $for_a_while; seek( FILE, 0, 1 ); }