in reply to How to tell if a Directory is Empty
use 5.010; use Path::Class qw(dir); my $dir = dir("/etc/httpd"); my $is_empty = $dir->stat && !$dir->children; [download]
The $dir->stat call is needed because $dir->children throws on non-existent directories.