{ PERL_MAGIC_sv, "sv(\\0)" },
{ PERL_MAGIC_arylen, "arylen(#)" },
{ PERL_MAGIC_rhash, "rhash(%)" },
- { PERL_MAGIC_glob, "glob(*)" },
{ PERL_MAGIC_pos, "pos(.)" },
{ PERL_MAGIC_symtab, "symtab(:)" },
{ PERL_MAGIC_backref, "backref(<)" },
else if (v == &PL_vtbl_dbline) s = "dbline";
else if (v == &PL_vtbl_isa) s = "isa";
else if (v == &PL_vtbl_arylen) s = "arylen";
- else if (v == &PL_vtbl_glob) s = "glob";
else if (v == &PL_vtbl_mglob) s = "mglob";
else if (v == &PL_vtbl_nkeys) s = "nkeys";
else if (v == &PL_vtbl_taint) s = "taint";
*a,
'SV = PVGV\\($ADDR\\) at $ADDR
REFCNT = 5
- FLAGS = \\(SMG,SCREAM,MULTI(?:,IN_PAD)?\\)
+ FLAGS = \\(SCREAM,MULTI(?:,IN_PAD)?\\)
IV = 0
NV = 0
PV = 0
- MAGIC = $ADDR
- MG_VIRTUAL = &PL_vtbl_glob
- MG_TYPE = PERL_MAGIC_glob\(\*\)
- MG_OBJ = $ADDR
NAME = "a"
NAMELEN = 1
GvSTASH = $ADDR\\t"main"
GvFILE(gv) = CopFILE(PL_curcop) ? CopFILE(PL_curcop) : (char *) "";
GvCVGEN(gv) = 0;
GvEGV(gv) = gv;
- sv_magic((SV*)gv, (SV*)gv, PERL_MAGIC_glob, NULL, 0);
SvSCREAM_on(gv);
GvSTASH(gv) = stash;
if (stash)
#define PERL_MAGIC_substr 'x' /* substr() lvalue */
#define PERL_MAGIC_defelem 'y' /* Shadow "foreach" iterator variable /
smart parameter vivification */
-#define PERL_MAGIC_glob '*' /* GV (typeglob) */
#define PERL_MAGIC_arylen '#' /* Array length ($#ary) */
#define PERL_MAGIC_pos '.' /* pos() lvalue */
#define PERL_MAGIC_backref '<' /* for weak ref data */
);
MGVTBL_SET(
- PL_vtbl_glob,
- NULL,
- MEMBER_TO_FPTR(Perl_magic_setglob),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-);
-
-MGVTBL_SET(
PL_vtbl_mglob,
NULL,
MEMBER_TO_FPTR(Perl_magic_setmglob),
y PERL_MAGIC_defelem vtbl_defelem Shadow "foreach" iterator
variable / smart parameter
vivification
- * PERL_MAGIC_glob vtbl_glob GV (typeglob)
# PERL_MAGIC_arylen vtbl_arylen Array length ($#ary)
. PERL_MAGIC_pos vtbl_pos pos() lvalue
< PERL_MAGIC_backref vtbl_backref back pointer to a weak ref
/* don't upgrade SVt_PVLV: it can hold a glob */
if (dtype != SVt_PVLV)
sv_upgrade(dstr, SVt_PVGV);
- sv_magic(dstr, dstr, PERL_MAGIC_glob, NULL, 0);
GvSTASH(dstr) = GvSTASH(sstr);
if (GvSTASH(dstr))
Perl_sv_add_backref(aTHX_ (SV*)GvSTASH(dstr), dstr);
assert(!(sflags & SVf_NOK));
assert(!(sflags & SVf_IOK));
}
+ else if (dtype == SVt_PVGV) {
+ if (!(sflags & SVf_OK)) {
+ if (ckWARN(WARN_MISC))
+ Perl_warner(aTHX_ packWARN(WARN_MISC),
+ "Undefined value assigned to typeglob");
+ }
+ else {
+ GV *gv = gv_fetchsv(sstr, GV_ADD, SVt_PVGV);
+ if (dstr != (SV*)gv) {
+ if (GvGP(dstr))
+ gp_free((GV*)dstr);
+ GvGP(dstr) = gp_ref(GvGP(gv));
+ }
+ }
+ }
else if (sflags & SVp_POK) {
bool isSwipe = 0;
}
}
else {
- if (dtype == SVt_PVGV) {
- if (ckWARN(WARN_MISC))
- Perl_warner(aTHX_ packWARN(WARN_MISC), "Undefined value assigned to typeglob");
- }
- else if ((stype == SVt_PVGV || stype == SVt_PVLV)
+ if ((stype == SVt_PVGV || stype == SVt_PVLV)
&& (sflags & SVp_SCREAM)) {
/* This stringification rule for globs is spread in 3 places.
This feels bad. FIXME. */
case PERL_MAGIC_defelem:
vtable = &PL_vtbl_defelem;
break;
- case PERL_MAGIC_glob:
- vtable = &PL_vtbl_glob;
- break;
case PERL_MAGIC_arylen:
vtable = &PL_vtbl_arylen;
break;
sv_del_backref((SV*)GvSTASH(sv), sv);
GvSTASH(sv) = NULL;
}
- sv_unmagic(sv, PERL_MAGIC_glob);
SvSCREAM_off(sv);
Safefree(GvNAME(sv));
GvMULTI_off(sv);
case want_vtbl_arylen:
result = &PL_vtbl_arylen;
break;
- case want_vtbl_glob:
- result = &PL_vtbl_glob;
- break;
case want_vtbl_mglob:
result = &PL_vtbl_mglob;
break;