int
mop_get_code_info (SV *coderef, char **pkg, char **name)
{
- GV *gv;
-
if (!SvOK(coderef) || !SvROK(coderef) || SvTYPE(SvRV(coderef)) != SVt_PVCV) {
return 0;
}
*/
if ( isGV_with_GP(CvGV(coderef)) ) {
- gv = CvGV(coderef);
- *pkg = HvNAME( GvSTASH(gv) ? GvSTASH(gv) : CvSTASH(coderef) );
- *name = GvNAME( CvGV(coderef) );
+ GV *gv = CvGV(coderef);
+ *pkg = HvNAME( GvSTASH(gv) ? GvSTASH(gv) : CvSTASH(coderef) );
+ *name = GvNAME( CvGV(coderef) );
} else {
- *pkg = "__UNKNOWN__";
- *name = "__ANON__";
+ *pkg = "__UNKNOWN__";
+ *name = "__ANON__";
}
return 1;
DECLARE_KEY_WITH_VALUE(package_cache_flag, "_package_cache_flag"),
DECLARE_KEY(methods),
DECLARE_KEY(VERSION),
- DECLARE_KEY(ISA)
+ DECLARE_KEY(ISA),
+ DECLARE_KEY_WITH_VALUE(_version, "-version")
};
SV *