use File::Find::Rule; my @list = File::Find::Rule->in('/aa'); # OR my @dirs_only = File::Find::Rule->directory()->in('/aa');