in reply to Directory path and -d??

readdir only returns the filenames, not the full path, so you either have to chdir to the dir you are working with, or prepend the full path to the filename before using it. ie:
my $dir = 'D:'; opendir dirs2, $dir or die "Couldn't open directory: $!"; while ($_ = (readdir dirs2)) { if (-d "$dir/$_") { print "Directory: $_\n"; } }