dipesh777 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am trying to write a code which will print not empty until the directory is not empty and will eventually print empty when its empty. I am trying to use while loop but not able to continue to check the dir continuously. Can you please let me know how can i do that using while or until loop?

example: there are 100 files in folder and its being processed. is folder is empty then stop else continue to check until its empty.

using following code to see dir is empty or not
use strict; use warnings; if (scalar </tmp/dipesh/*>) { print "not empty"; } else { print "Empty"; }
Thanks,

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.