foreach(@dir) { if (-d$_) {print $_," is a directory.\n"; } #### foreach(@dir) { my $subdir = $dir.$_; if (-d$_) {print $_," is a directory.\n"; }