superpete has asked for the wisdom of the Perl Monks concerning the following question:
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?
-e "$dir/foo" or mkdir "$dir/foo"
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: suppressing stat/newline warning
by Zaxo (Archbishop) on Nov 14, 2002 at 06:27 UTC | |
by superpete (Beadle) on Nov 14, 2002 at 19:36 UTC |