in reply to How to list all the subdirectories in a directory

Get the contents of the folder (using readdir, for example) and use -d to find out if a file is really a directory.

You could also use a module such as File::Find::Rule, but such modules search recursively by default. You'll need to limit the depth of the search.