http://www.perlmonks.org?node_id=530557


in reply to Perl stricter than my OS regarding file/dir names

'perldoc perldiag'
Unsuccessful %s on filename containing newline

(W newline) A file operation was attempted on a filename, and that operation failed, PROBABLY because the filename contained a newline, PROBABLY because you forgot to chomp() it off. See chomp in the perlfunc manpage.

If you grep the perl source, you'll find these tests
######## # doio.c [Perl_my_stat Perl_my_lstat] use warnings 'io' ; stat "ab\ncd"; lstat "ab\ncd"; no warnings 'io' ; stat "ab\ncd"; lstat "ab\ncd"; EXPECT Unsuccessful stat on filename containing newline at - line 3. Unsuccessful stat on filename containing newline at - line 4.
######## # pp_sys.c [pp_stat] use warnings 'newline' ; stat "abc\ndef"; no warnings 'newline' ; stat "abc\ndef"; EXPECT Unsuccessful stat on filename containing newline at - line 3.
So to disable that particular warning, through warnings, you simply write
no warnings 'newline'; next if -d "$dir/$current_filename";
perllexwarn lists newline among others (though it doesn't really explain what warnings it blocks).

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.