sub find_modules {
my @modules;
- find({
+ find( {
wanted => sub {
-f $_ or return;
s/\.pm$// or return;
push @modules, join ('::', File::Spec->splitdir($_));
},
no_chdir => 1,
- }, qw( lib blib ) ); # find them in both lib and blib, @INC is preadjusted for us by the harness
+ }, (
+ # find them in both lib and blib, duplicates are fine, since
+ # @INC is preadjusted for us by the harness
+ 'lib',
+ ( -e 'blib' ? 'blib' : () ),
+ ));
return sort @modules;
}