else if ((COP*)PL_curcop == &PL_compiling) {
stash = PL_curstash;
if (add && (PL_hints & HINT_STRICT_VARS) &&
+ !(add & GV_ADDOUR) &&
sv_type != SVt_PVCV &&
sv_type != SVt_PVGV &&
sv_type != SVt_PVFM &&
/* By this point we should have a stash and a name */
if (!stash) {
- if (!add)
- return Nullgv;
- {
- char sv_type_char = ((sv_type == SVt_PV) ? '$'
- : (sv_type == SVt_PVAV) ? '@'
- : (sv_type == SVt_PVHV) ? '%'
- : 0);
- if (sv_type_char)
- Perl_warn(aTHX_ "Global symbol \"%c%s\" requires explicit package name",
- sv_type_char, name);
- else
- Perl_warn(aTHX_ "Global symbol \"%s\" requires explicit package name",
- name);
+ if (add) {
+ qerror(Perl_mess(aTHX_
+ "Global symbol \"%s%s\" requires explicit package name",
+ (sv_type == SVt_PV ? "$"
+ : sv_type == SVt_PVAV ? "@"
+ : sv_type == SVt_PVHV ? "%"
+ : ""), name));
}
- ++PL_error_count;
- stash = PL_curstash ? PL_curstash : PL_defstash; /* avoid core dumps */
- add_gvflags = ((sv_type == SVt_PV) ? GVf_IMPORTED_SV
- : (sv_type == SVt_PVAV) ? GVf_IMPORTED_AV
- : (sv_type == SVt_PVHV) ? GVf_IMPORTED_HV
- : 0);
+ return Nullgv;
}
if (!SvREFCNT(stash)) /* symbol table under destruction */
}
}
break;
+ case 'V':
+ if (strEQ(name, "VERSION"))
+ GvMULTI_on(gv);
+ break;
case '&':
if (len > 1)
break;
if (sv_type > SVt_PV && PL_curcop != &PL_compiling) {
HV* stash = gv_stashpvn("Errno",5,FALSE);
- if(!stash || !(gv_fetchmethod(stash, "TIEHASH"))) {
+ if (!stash || !(gv_fetchmethod(stash, "TIEHASH"))) {
dSP;
PUTBACK;
require_pv("Errno.pm");
case '/':
case '|':
case '\001':
- case '\002':
case '\003':
case '\004':
case '\005':
case '\017':
case '\020':
case '\024':
- case '\027':
if (len > 1)
break;
goto magicalize;
if (len > 1)
break;
goto ro_magicalize;
+ case '\027': /* $^W & $^Warnings */
+ if (len > 1 && strNE(name, "\027arnings"))
+ break;
+ goto magicalize;
case '+':
if (len > 1)
void
Perl_gp_free(pTHX_ GV *gv)
{
+ dTHR;
GP* gp;
CV* cv;
- dTHR;
if (!gv || !(gp = GvGP(gv)))
return;
- if (gp->gp_refcnt == 0 && ckWARN_d(WARN_INTERNAL)) {
- Perl_warner(aTHX_ WARN_INTERNAL, "Attempt to free unreferenced glob pointers");
+ if (gp->gp_refcnt == 0) {
+ if (ckWARN_d(WARN_INTERNAL))
+ Perl_warner(aTHX_ WARN_INTERNAL,
+ "Attempt to free unreferenced glob pointers");
return;
}
if (gp->gp_cv) {