my @files = grep { -f } map { "$dir/$_" } readdir($dirhandle);