my @dirs = grep { /\w/ and -d "$dir/$_" } readdir(DIR); closedir (DIR); foreach my $subdir (@dirs){