in reply to file's treatment
In almost all such cases, the cause is that the "current directory" and the "path to your file" together do not work out to an existing file anymore. readdir returns you only the file names, and not the directory name.
I suggest that you add the directory to the file names as well, so you don't get confused as which files comes from where:
use File::Spec; my $dir = 'c:/test/'; opendir ORIG, $dir or die "Couldn't read '$dir': $!"; my @listDir = map { File::Spec->catfile( $dir, $_ )} readdir(ORIG); closedir ORIG; print $_ for @listDir;
|
|---|