Assuming you're using the
parse_dir function from the
File::Listing module...
The following will populate the @dirs array with the names of the sub-directories in the current directory (excluding all hidden directories which begin with the dot character):
use File::Listing qw(parse_dir);
my @dirs = map { my( $name, $type ) = @$_; $type eq 'd' ? $name : () }
+ parse_dir(`ls -l`);
To include 'dot' directories (except for the special . and .. directories), you'd simply use ls -la:
my @dirs = map { my( $name, $type ) = @$_; $type eq 'd' ? $name : () }
+ parse_dir(`ls -la`);