Index: mod_perl.c
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/mod_perl.c,v
retrieving revision 1.141
diff -u -r1.141 mod_perl.c
--- mod_perl.c	2001/07/10 03:30:27	1.141
+++ mod_perl.c	2001/08/27 18:12:49
@@ -1199,20 +1199,33 @@
 	if (gvp) cv = GvCV(gvp);
     }
 
+    if (cv != NULL) {
+      is_method = perl_cv_ismethod(cv);
+    }
+
+    MP_TRACE_h(fprintf(stderr, "checking if `%s' is a method...%s\n", 
+	   sub, (is_method ? "yes" : "no")));
+    SvREFCNT_dec(sv);
+    return is_method;
+}
+
+int perl_cv_ismethod(CV *cv)
+{
+    int is_method=0;
+
 #ifdef CVf_METHOD
     if (cv && (CvFLAGS(cv) & CVf_METHOD)) {
         is_method = 1;
     }
 #endif
+
     if (!is_method && (cv && SvPOK(cv))) {
 	is_method = strnEQ(SvPVX(cv), "$$", 2);
     }
 
-    MP_TRACE_h(fprintf(stderr, "checking if `%s' is a method...%s\n", 
-	   sub, (is_method ? "yes" : "no")));
-    SvREFCNT_dec(sv);
     return is_method;
 }
+
 #endif
 
 void mod_perl_noop(void *data) {}
@@ -1453,6 +1466,7 @@
     HV *stash = Nullhv;
     SV *pclass = newSVsv(sv), *dispsv = Nullsv;
     CV *cv = Nullcv;
+    GV *gv = Nullgv;
     char *method = "handler";
     int defined_sub = 0, anon = 0;
     char *dispatcher = NULL;
@@ -1587,8 +1601,27 @@
 #endif
     }
     else {
-	MP_TRACE_h(fprintf(stderr, "perl_call: handler is a %s\n", 
-			 dispatcher ? "dispatcher" : "cached CV"));
+        if (!dispatcher) {
+	  MP_TRACE_h(fprintf(stderr, "perl_call: handler is a cached CV\n"));
+#ifdef PERL_METHOD_HANDLERS
+          cv = sv_2cv(sv, &stash, &gv, FALSE);
+
+          if (cv != NULL) {
+	    is_method = perl_cv_ismethod(cv);
+          }
+
+          if (is_method) {
+              pclass = newSVpv(HvNAME(stash),0);
+              method = GvNAME(CvGV(cv));
+          }
+
+          MP_TRACE_h(fprintf(stderr, "checking if CV is a method...%s\n",
+                 (is_method ? "yes" : "no")));
+#endif
+        }
+	else {
+          MP_TRACE_h(fprintf(stderr, "perl_call: handler is a dispatcher\n"));
+        }
     }
 
 callback:

