On 03/19/04 00:58, Andrew Gaffney wrote:
I keep getting the following errors in my Apache error log every time a certain script is run:

Prototype mismatch: sub Apache::ROOT::cgi_2dbin::showday_2epl::time2str vs ($;$$) at /usr/lib/perl5/5.8.0/Exporter.pm line 59.
at /home/httpd/cgi-bin/showday.pl line 4
Prototype mismatch: sub Apache::ROOT::cgi_2dbin::showday_2epl::strftime vs ($\@;$) at /usr/lib/perl5/5.8.0/Exporter.pm line 59.
at /home/httpd/cgi-bin/showday.pl line 4
Prototype mismatch: sub Apache::ROOT::cgi_2dbin::showday_2epl::ctime vs ($;$) at /usr/lib/perl5/5.8.0/Exporter.pm line 59.
at /home/httpd/cgi-bin/showday.pl line 4
Prototype mismatch: sub Apache::ROOT::cgi_2dbin::showday_2epl::asctime vs (\@;$) at /usr/lib/perl5/5.8.0/Exporter.pm line 59.
at /home/httpd/cgi-bin/showday.pl line 4


Relevant lines of showday.pl are:

#!/usr/bin/perl

use CGI;
use Date::Format; # line 4
use Time::Local;

Can anyone tell me how to get these errors/warnings to stop popping up everytime this script is run? This script is run a lot and it's filling up my error log.

Looks like you are using two modules that define the same subs. You should block the exported subs in one of the modules and just use the fully qualified names:


use Date::Format (); # Don't import subs.
...
Date::Format::asctime(); # use fully qualified names

Alternatively you can just import the subs that you want from each of the modules you use, making sure not to import two functions of the same name. This is generally a good practice anyway.

Regards,
Randy.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to