opendir(my $dirh, "/somewhere") or die; while(1) { while(my $file = readdir($dirh)) { print("$file\n"); } sleep(1); }