Path::Class offers a way. The module is portable across different file systems though the example is *nix. The main advantage to using this approach is it grows nicely and lets you pass things around easily.
moo@cow~>mkdir temp moo@cow~>perl -MPath::Class -le 'print Path::Class::Dir->new("./temp") +->children == 0 ? "none" : "some"' none moo@cow~>touch temp/fish moo@cow~>perl -MPath::Class -le 'print Path::Class::Dir->new("./temp") +->children == 0 ? "none" : "some"' some
In reply to Re: Quickly checking if a directory is empty
by Your Mother
in thread Quickly checking if a directory is empty
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |