I'm trying to get a simple listing of all the sub folders (but not files) in a certain directory. I can't figure for the life of me what's wrong with this code. I put in the Cwd thing to make sure the path was correct, and it is, but I just keep getting a result of "..." which I understand is a combination of "." and ".." but it doesn't list any subdirectories. The folder DEFINATELY has subdirectories, and I'm running this on a Win95 machine. Any ideas? Here's my code:
use Cwd;
print "Current dir is: ", cwd, "\n";
local $_;
opendir(TEXTFILES, "desktop") || die "Couldn't open the text file dire
+ctory: $!";
@data=readdir(TEXTFILES);
foreach (@data) {
print if(-d "./$_");
}
closedir(TEXTFILES);