Description of Problem: File::stat::stat(), when called on a file that does not exist, causes a message to get printed to stderr if -w was passed to perl. It should just return undef. This problem did not exist in RedHat 7.2. Version-Release number of selected component (if applicable): perl-5.6.1-34.99.6 How Reproducible: always Steps to Reproduce: 1. perl -w -e 'use File::stat; stat("/does/not/exist");' Actual Results: stat() on unopened filehandle /does/not/exist at /usr/lib/perl5/5.6.1/File/stat.pm line 49. Expected Results: No output should have been generated. Additional Information: No doubt perl 5.6.1 is checking for something that 5.6.0 didn't check. The stat.pm code is unchanged. This patch to /usr/lib/perl/5.6.1/File/stat.pm fixes the problem. Locally disabling $^W is no worse that locally disabling strict 'refs', which the code already does. I'm including it inline since it's so small, but I'll also attach it as an attached file. --- stat.pm~ Mon Apr 1 12:28:01 2002 +++ stat.pm Wed Jun 12 16:16:21 2002 @@ -45,6 +45,7 @@ my $st = populate(CORE::stat $arg); return $st if $st; no strict 'refs'; + local($^W) = 0; require Symbol; return populate(CORE::stat \*{Symbol::qualify($arg)}); }
Created attachment 60727 [details] patch to fix problem
this is fixed in perl 5.8.0 in Rawhide. unlikely to fix in 7.2 or 7.3, however, unless an errata becomes necessary.