my $n = 10 * 60; while (1) { sleep $n; # sleep 10 minutes # do your stuff to get and parse newsgroup stuff }