in reply to The "readdir()" fails to detect files created after the call to "opendir()"

You need to reload the directory for each iteration of the outer loop:
#!/usr/bin/perl use strict; use warnings; while (opendir my $dirh, "/somewhere/else") { while (my $file = readdir $dirh) { print "$file\n"; } sleep 1; }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: The "readdir()" fails to detect files created after the call to "opendir()"
  • Download Code