I put the -X test in there because the original poster mentioned looking for files. If the existence of a sub-directory is appropriate, you can leave it out.sub AreThereFiles { opendir DIR, "/path/to/nowhere" or die "That will linger: $!\n"; while (my $foo = readir DIR ) { chomp $foo; next if ( $foo =~ m/^\.\.?$/ ); next unless (-f $foo); closedir DIR; return 1; } closedir DIR; return 0; }
In reply to RE: RE: Empty directory
by chromatic
in thread Empty directory
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |