Did you turn the result of readdir (which is just the name within the selected directory) into a path by reattaching the directory name in front? If not, you're gonna get an odd response.
| [reply] |
Thank you, Thank you, Thank you. By referencing the full file path within the condition test, instead of just the name of the file, this works. I was mistakenly under the impression that by being positioned in that directory, on the direcory read, perl would resolve the file as to being a sub-directory or a file. But your method worked fine. Thanks again.
| [reply] |
#!perl -w
use strict;
opendir (DIR, './') || die "can't open dir:: $! \n";
for my $file(readdir(DIR)) {
next if -d $file;
print $file."\n";
}
| [reply] [d/l] |
Thanks, but the response by Merlyn did the trick.
| [reply] |