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