http://www.perlmonks.org?node_id=806246


in reply to Returning sub directories

What have you tried that didn't work? (a), (b), and (c) can be quite simply accomplished in one line using readdir, -d and grep. This can then be fed into a foreach loop.

If you don't want to code that much and don't actually care about what your subdirectories are, you can do something similar with File::Find.