Unfortunately the following line doesn't work:
eval "*{\$fullname}($p) = sub {}";
It probably should be:
eval "*{\$fullname} = sub ($p) {}";
The latter works on my Linux and Solaris tests.
Wenzhong Tang
[EMAIL PROTECTED]
-----Original Message-----
From: Doug MacEachern [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 11:03 PM
To: Wenzhong Tang
Cc: [EMAIL PROTECTED]
Subject: RE: Prototype mismatch in Apache::PerlRun line 343
On Wed, 17 Jan 2001, Wenzhong Tang wrote:
> 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:
thanks for you patch, however this is not valid Perl syntax:
> > eval "\$mysub = sub {$proto} {}";
below is a different version, does it still quiet the warnings?
Index: lib/Apache/PerlRun.pm
===================================================================
RCS file: /home/cvs/modperl/lib/Apache/PerlRun.pm,v
retrieving revision 1.34
diff -u -r1.34 PerlRun.pm
--- lib/Apache/PerlRun.pm 2001/01/12 15:45:12 1.34
+++ lib/Apache/PerlRun.pm 2001/01/26 06:58:39
@@ -340,7 +340,12 @@
if (defined &$fullname) {
no warnings;
local $^W = 0;
- *{$fullname} = sub {};
+ if (my $p = prototype $fullname) {
+ eval "*{\$fullname}($p) = sub {}";
+ }
+ else {
+ *{$fullname} = sub {};
+ }
undef &$fullname;
}
if (*{$fullname}{IO}) {