Since nobody seems care about this problem, I have to find a solution
myself.  Fortunately perl has a "prototype" function that returns the
prototype of a function.  Here is the difference between the original
PerlRun.pm in mod_perl 1.24_01 and the updated one:

343c343,350
<             *{$fullname} = sub {};
---
>             my $proto = prototype($fullname);
>               if (defined $proto) {
>                 my $mysub;
>                   eval "\$mysub = sub {$proto} {}"; 
>                   *{$fullname} = $mysub;
>               } else {
>                     *{$fullname} = sub {};
>               }

It works fine so far on my server.

It would be great if the next release of PerlRun.pm can do something like
this to greatly reduce the number of unnecessary "Prototype mismatch"
warnings in error_log.

Wenzhong Tang
Appliant.com
[EMAIL PROTECTED]

-----Original Message-----
From: Wenzhong Tang 
Sent: Friday, January 12, 2001 4:36 PM
To: '[EMAIL PROTECTED]'
Subject: Prototype mismatch in Apache::PerlRun line 343


Hi folks,

I am running a CGI script under Apache/mod_perl using Apache::PerlRun.  I
constantly got warning messaegs similiar to the one showing below:

[Thu Jan 11 18:45:49 2001] null: Prototype mismatch: sub
Apache::ROOT::login_2ecgi::gettimeofday () vs none at
/usr/lib/perl5/site_perl/5.005/i386-linux/Apache/PerlRun.pm line 343.

My CGI scripts seem to work just fine since the compliant happened in
flush_namespace.  I think I know why it is happening:  gettimeofday() in
Time::HiRes uses function prototype in the module, but line 343 in
PerlRun.pm 
    *{$fullname} = sub {};
doesn't know anything about it.

Is there a good way of fixing it?

Thanks,

Wenzhong

Reply via email to