File::stat prototype mismatch in error log
am 29.05.2008 19:48:25 von John Gateley
Hi,
I'm using Apache2 and mod_perl
Server: Apache2/2.0.55 (Ubuntu) mod_ssl/2.0.55 OpenSSL/0.9.8a mod_perl/2.0.2 Perl/v5.8.7
I am getting the following error in /var/log/apache2/error.log
Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::home_yadb_httpd_cgi_2dbin_C overArtSubmitFile_2ecgi::lstat: none vs ($) at /usr/share/perl/5.8/Exporter.pm line 65.
at /home/yadb/httpd/cgi-bin/CoverArtSubmitFile.cgi line 13
CoverArtSubmitFile.cgi line 13 is:
use File::stat;
My subsequent calls to stat work fine, so it's not fatal:
my $StatObj = stat($TempFile->filename);
....
$StatObj->size
....
What does the error mean? And how can I get rid of it?
Thanks,
j
--
John Gateley
Re: File::stat prototype mismatch in error log
am 29.05.2008 20:33:54 von mpeters
John Gateley wrote:
> Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::home_yadb_httpd_cgi_2dbin_C overArtSubmitFile_2ecgi::lstat: none vs ($) at /usr/share/perl/5.8/Exporter.pm line 65.
> at /home/yadb/httpd/cgi-bin/CoverArtSubmitFile.cgi line 13
>
> CoverArtSubmitFile.cgi line 13 is:
>
> use File::stat;
So by default it's trying to override the built-in stat() function. Seems to be
conflicting. Overriding built-in's usually not a good idea.
> My subsequent calls to stat work fine, so it's not fatal:
>
> my $StatObj = stat($TempFile->filename);
Seems strange the you're using File::stat because it provides object oriented
access to that information, yet you're calling it as a function, not a
namespaced method. Try replacing that with (notice my non-use of CamelCase :)
my $stat_obj = File::stat->new($temp_file->filename);
--
Michael Peters
Plus Three, LP
Re: File::stat prototype mismatch in error log
am 29.05.2008 22:52:24 von John Gateley
On Thu, 29 May 2008 14:33:54 -0400
Michael Peters wrote:
> John Gateley wrote:
>
> > use File::stat;
>
> So by default it's trying to override the built-in stat() function. Seems to be
> conflicting. Overriding built-in's usually not a good idea.
Thanks - I changed it to "use File::stat ()" so the built-in
wasn't overridden, and then the call to "File::stat::stat(...)"
and that fixed it.
> Try replacing that with (notice my non-use of CamelCase :)
>
> my $stat_obj = File::stat->new($temp_file->filename);
You say "KA-mul", I say "kah-MEL" :)
Thanks again...
j
--
John Gateley