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