I suggested a $File::Find::prune approach in the chatterbox, but now I wonder whether readdir() together with -f wouldn't be better (untested):
opendir DIR, "/"; my @files = readdir DIR; closedir DIR; @files = grep { -d "/$_" } @files; my $dirname; foreach $dirname @DIR { if (-f "/$dirname/foo.bar") { print "$dirname has foo.bar\n" }; };
In reply to Re: The situational efficiency of File::Find
by Corion
in thread The situational efficiency of File::Find
by OzzyOsbourne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |