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