The stupid question is the question not asked | |
PerlMonks |
suppressing stat/newline warningby superpete (Beadle) |
on Nov 14, 2002 at 06:17 UTC ( [id://212775]=perlquestion: print w/replies, xml ) | Need Help?? |
superpete has asked for the wisdom of the Perl Monks concerning the following question:
In my quest
to make my code support completely arbitrary filenames, I think i've succeeded.
But I have uncovered a new issue. Whenever a "-X" test returns a negative result, and the filename happens to have a newline in it (newlines are valid in unix filenames), perl issues a "Unsuccessful stat on filename containing newline" warning. (if we're running perl -w) According to the perldiag manpage, perl thinks I forgot to chomp my filename. But what if the filename really has a newline in it?
If $dir happens to have a newline in it, the code results in a warning :-( What to do? Is there a way to suppress that one specific warning?
Back to
Seekers of Perl Wisdom
|
|