in reply to Getting a list of directories matching a pattern

You can use glob to get all files (a directory is just special kind of file), then use grep to filter out the plain files. To get directories underneath the currently running program...
#!/usr/bin/perl use warnings; use strict; my @dirs = grep{-d $_}glob "*"; print join "\n",@dirs;
Make sure you take into account the path if not in the current directory.