my @files = grep { !-d } map { catdir($dir, $_) } readdir($dh);