loop: opendir (DIR, $watcheddir); @files=grep {!/^\./} readdir (DIR); closedir DIR; foreach $currentfile (@files) { &filecontents; } sleep 10; goto loop;