#!/usr/bin/perl -w use strict; my $path = 'C:/temp/'; my @filearray = grep{-d}glob("$path*"); print join("\n",@filearray);