#usr/bin/perl -w use strict; my $root = 'c:/'; my @subdirs; opendir DIR, $root or die "Oops $!\n"; while (my $file = readdir DIR) { push @subdirs, $root.$file if -d $root.$file;; } print "The subdirs of $root are:\n"; print "$_\n" for @subdirs;