You aren't telling us if the directory exists or not. Perl only gives you a helpfull warning, just in case you are trying to stat a file/directory with a newline in it - which would be a common programming error.
If you want to avoid the warning, just use
{ no warnings 'newline';
next if -d "$dir/$current_filename";
};
| [reply] [Watch: Dir/Any] [d/l] [select] |
$ perl -le 'for (1..10) { { next if 1 }; print }'
1
2
3
4
5
6
7
8
9
10
| [reply] [Watch: Dir/Any] [d/l] |
Not sure why the existence of the directory would matter. Most of the time, it doesn't exist.
user@host:/home
# perl -w
print "OK" if -d 'I_swear_this_file_aint_here';
print "See, I told you.\n"
<CTRL+D>
See, I told you.
user@host:/home
I see no special output if the tested for file doesn't exist. It just silently fails.
But...
Thanks for the warnings info! That looks to be what I need, I'll bet.
| [reply] [Watch: Dir/Any] [d/l] |