#define PERL_IN_GV_C
#include "perl.h"
+const char S_autoload[] = "AUTOLOAD";
+const STRLEN S_autolen = sizeof(S_autoload)-1;
+
GV *
Perl_gv_AVadd(pTHX_ register GV *gv)
{
GV *gv = gv_fetchmeth(stash, name, len, level);
if (!gv) {
- const char autoload[] = "AUTOLOAD";
- STRLEN autolen = sizeof(autoload)-1;
CV *cv;
GV **gvp;
if (!stash)
return Nullgv; /* UNIVERSAL::AUTOLOAD could cause trouble */
- if (len == autolen && strnEQ(name, autoload, autolen))
+ if (len == S_autolen && strnEQ(name, S_autoload, S_autolen))
return Nullgv;
- if (!(gv = gv_fetchmeth(stash, autoload, autolen, FALSE)))
+ if (!(gv = gv_fetchmeth(stash, S_autoload, S_autolen, FALSE)))
return Nullgv;
cv = GvCV(gv);
if (!(CvROOT(cv) || CvXSUB(cv)))
Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method)
{
dVAR;
- const char autoload[] = "AUTOLOAD";
- const STRLEN autolen = sizeof(autoload)-1;
GV* gv;
CV* cv;
HV* varstash;
SV* varsv;
const char *packname = "";
- if (len == autolen && strnEQ(name, autoload, autolen))
+ if (len == S_autolen && strnEQ(name, S_autoload, S_autolen))
return Nullgv;
if (stash) {
if (SvTYPE(stash) < SVt_PVHV) {
packname = HvNAME(stash);
}
}
- if (!(gv = gv_fetchmeth(stash, autoload, autolen, FALSE)))
+ if (!(gv = gv_fetchmeth(stash, S_autoload, S_autolen, FALSE)))
return Nullgv;
cv = GvCV(gv);
* original package to look up $AUTOLOAD.
*/
varstash = GvSTASH(CvGV(cv));
- vargv = *(GV**)hv_fetch(varstash, autoload, autolen, TRUE);
+ vargv = *(GV**)hv_fetch(varstash, S_autoload, S_autolen, TRUE);
ENTER;
if (!isGV(vargv))
- gv_init(vargv, varstash, autoload, autolen, FALSE);
+ gv_init(vargv, varstash, S_autoload, S_autolen, FALSE);
LEAVE;
varsv = GvSV(vargv);
sv_setpv(varsv, packname);