When I'm stumped I often try reducing the script to the bare bones to get something working and gradually add things back in.
Something like:
#!/usr/bin/perl
use warnings;
use strict;
my $dir = 'c:/Perl';
opendir DIR_A, $dir
or die $!;
while(my $job = readdir(DIR_A)){
print "$job\n";
}
__DATA__
---------- Capture Output ----------
> "C:\Perl\bin\perl.exe" _new.pl
.
..
bin
Desktop.ini
eg
html
lib
myperl
site
Tidy
> Terminated with exit code 0.
When you come up against the error you'll have a better chance of narrowing down the source of your grief.
Hope that helps.