find(\&wanted, $directory); sub wanted { if (-d $_) { push(@dirList,$_); }