opendir(DIR, "t:\\") or die "can't opendir $dirname: $!"; @files = readdir(DIR); closedir(DIR); foreach $file (@files) { print "$file\n";