use File::Find::Rule 0.30; my $string = "C:/cFiles"; # works just as well here my $list = join "\n", File::Find::Rule->maxdepth(1)->in($string);