in reply to The situational efficiency of File::Find

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" }; };