in reply to How to get the names of sub-directory in a directory?
If you only want the immediate sub-directories, you can use grep and -d on the entries returned to work out what they are, using the handy (and easily adapted) example from readdir's perldoc entry.
opendir(DIR, $some_dir) || die "Can't opendir $some_dir: $!"; @subdirs = grep { -d "$some_dir/$_" } readdir(DIR); closedir DIR;
If you want all the sub-directories (including the sub-directories of sub-directories), then you probably want to take a look at File::Find instead.
--k.
|
|---|