in reply to Cannot open file within a loop
What directory is $file in? is it the same one that $dir is in?
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.
http://perldoc.perl.org/functions/readdir.html
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Cannot open file within a loop
by ic23oluk (Sexton) on Jun 14, 2017 at 07:10 UTC | |
by huck (Prior) on Jun 14, 2017 at 07:36 UTC | |
by ic23oluk (Sexton) on Jun 14, 2017 at 07:41 UTC |