use File::Find::Rule; # find all the subdirectories of a given directory my ($subdir) = File::Find::Rule->directory->in( $s_dir )->name("$a_dir\$");