This has been asked many times. Even the documentation of
readdir itself mentions the problem:
If you're planning to filetest the return values out of a readdir, you'd better prepend the directory in question.
Also, you should always check the return value of opendir. Moreover, use strict and warnings, they should tell you that $fh and $dh are different variables.
So, all of that together:
#!/usr/bin/perl
use warnings;
use strict;
my $dir = 'C:/';
opendir my $dh, $dir or die $!;
while (my $file = readdir $dh) {
print "$file\n" if -d "$dir/$file";
}
close $dh;
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord
}map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,