modperl_mgv_compile(aTHX, p, HvNAME(GvSTASH(CvGV(cv))));
modperl_mgv_compile(aTHX_ p, HvNAME(GvSTASH(CvGV(cv))));
int modperl_mgv_resolve(pTHX_ modperl_handler_t *handler,                        apr_pool_t *p, const char *name){    CV *cv;    GV *gv;    HV *stash=Nullhv;    char *handler_name = "handler";    char *tmp;    if (strnEQ(name, "sub ", 4)) {        MP_TRACE_h(MP_FUNC, "handler is anonymous\n");        MpHandlerANON_On(handler);        MpHandlerPARSED_On(handler);        return 1;    }    if ((tmp = strstr((char *)name, "->"))) {        int package_len = strlen(name) - strlen(tmp);        char *package = apr_pstrndup(p, name, package_len);        name = package;        handler_name = &tmp[2];        MpHandlerMETHOD_On(handler);        if (*package == '$') {            GV *gv;            SV *obj;            handler->mgv_obj = modperl_mgv_compile(aTHX_ p, package + 1);            gv = modperl_mgv_lookup(aTHX_ handler->mgv_obj);            obj = gv ? GvSV(gv) : Nullsv;            if (SvTRUE(obj)) {                if (SvROK(obj) && sv_isobject(obj)) {                    stash = SvSTASH(SvRV(obj));                    MpHandlerOBJECT_On(handler);                    MP_TRACE_h(MP_FUNC, "handler object %s isa %s\n",                               package, HvNAME(stash));                }                else {                    MP_TRACE_h(MP_FUNC, "%s is not an object, pv=%s\n",                               package, SvPV_nolen(obj));                    return 0;                }            }            else {                MP_TRACE_h(MP_FUNC, "failed to thaw %s\n", package);                return 0;            }        }        if (!stash) {            if ((stash = gv_stashpvn(package, package_len, FALSE))) {                MP_TRACE_h(MP_FUNC, "handler method %s isa %s\n",                           name, HvNAME(stash));            }        }        MpHandlerPARSED_On(handler);    }    else {        if ((cv = get_cv(name, FALSE))) {            handler->mgv_cv =                modperl_mgv_compile(aTHX, p, HvNAME(GvSTASH(CvGV(cv))));            modperl_mgv_append(aTHX_ p, handler->mgv_cv, GvNAME(CvGV(cv)));            MpHandlerPARSED_On(handler);            return 1;        }    }    if (!(stash || (stash = gv_stashpv(name, FALSE))) &&        MpHandlerAUTOLOAD(handler)) {        MP_TRACE_h(MP_FUNC,                   "package %s not defined, attempting to load\n", name);        if (modperl_require_module(aTHX_ name)) {            MP_TRACE_h(MP_FUNC, "loaded %s package\n", name);            if (!(stash = gv_stashpv(name, FALSE))) {                MP_TRACE_h(MP_FUNC, "%s package still does not exist\n",                           name);                return 0;            }        }        else {            MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name);            return 0;        }    }    if ((gv = gv_fetchmethod(stash, handler_name)) && (cv = GvCV(gv))) {        if (CvFLAGS(cv) & CVf_METHOD) { /* sub foo : method {}; */            MpHandlerMETHOD_On(handler);            if (!handler->mgv_obj) {                modperl_mgv_new_name(handler->mgv_obj, p, HvNAME(stash));            }        }        /* note: this is the real function after @ISA lookup */        handler->mgv_cv = modperl_mgv_compile(aTHX_ p, HvNAME(GvSTASH(gv)));        modperl_mgv_append(aTHX_ p, handler->mgv_cv, handler_name);          MpHandlerPARSED_On(handler);        MP_TRACE_h(MP_FUNC, "found `%s' in class `%s' as a %s\n",                   handler_name, HvNAME(stash),                   MpHandlerMETHOD(handler) ? "method" : "function");        return 1;    }        MP_TRACE_h(MP_FUNC, "`%s' not found in class `%s'\n",               handler_name, name);    return 0;}