in reply to Problem pulling directories out of an array.
Prefix $dirtoget on the filenames. perldoc -f readdir
If you're planning to filetest the return values out of a "readdir", you'd better prepend the directory in question. Otherwise, because we didn't "chdir" there, it would have been testing the wrong file.
foreach my $f ( map { "$dirtoget/$_" } @thefiles ) { ... }
|
|---|