4 use List::MoreUtils qw(any);
23 my @current = find($ENV{HOME}, '.', sub {$_[0] =~ m/^\./});
32 my $dir = shift || '.';
33 my $sel = shift || sub {1};
35 my $dirpath = File::Spec->catfile($base, $dir);
36 opendir my $dh, $dirpath or die "opendir: $dirpath: $!";
39 while (my $name = readdir $dh) {
40 next if $name =~ /^\.\.?$/;
41 next if !$sel->($name);
43 my $abs = File::Spec->rel2abs($name, $dirpath);
44 my $rel = File::Spec->abs2rel($abs, $base);
46 next if any { $rel =~ m/$_/ } @RE_IGNORED;
50 push @d, find($base, $rel);