File::Find::Rule::DirectoryEmpty - find empty directories recursively
use File::Find::Rule::DirectoryEmpty; my @emptydirs = File::Find::Rule->directoryempty->in('/home/myself'); # another way.. my $o = new File::Find::Rule; $o->directoryempty; my @emptydirs = $o->in( $ENV{HOME} );
Matches only if it is an empty directory.
This module inherits File::Find::Rule. It lets you find empty directories recursively. Note that a directory with an empty directory inside it is not an empty directory.
Instead of reading full count of directory contents, we return false as soon as we match something other then . or .. This helps with speed.
This may not work on windows platforms. You're welcome to send in a patch for it.
File::Find::Rule
Leo Charre leocharre at cpan dot org
Copyright (c) 2009 Leo Charre. All rights reserved.
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e., under the terms of the "Artistic License" or the "GNU General Public License".
This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the "GNU General Public License" for more details.
To install File::Find::Rule::DirectoryEmpty, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Find::Rule::DirectoryEmpty
CPAN shell
perl -MCPAN -e shell install File::Find::Rule::DirectoryEmpty
For more information on module installation, please visit the detailed CPAN module installation guide.