gv = gvp ? *gvp : Nullgv;
if (gv && gv != (GV*)&sv_undef) {
if (SvTYPE(gv) != SVt_PVGV)
- gv_init(gv, stash, tmpbuf, len, (add & 2));
+ gv_init(gv, stash, tmpbuf, len, (add & GV_ADDMULTI));
else
GvMULTI_on(gv);
}
if (!stash) {
if (!add)
return Nullgv;
- if (add & ~2) {
+ if (add & ~GV_ADDMULTI) {
char sv_type_char = ((sv_type == SVt_PV) ? '$'
: (sv_type == SVt_PVAV) ? '@'
: (sv_type == SVt_PVHV) ? '%'
#define DM_EGID 0x020
#define DM_DELAY 0x100
-#define GV_ADD 0x01
-#define GV_ADDMULTI 0x02
-#define GV_ADDWARN 0x04
-#define GV_NOINIT 0x10 /* 8 is used without a symbolic constant */
+/*
+ * symbol creation flags, for use in gv_fetchpv() and perl_get_*v()
+ */
+#define GV_ADD 0x01 /* add, if symbol not already there */
+#define GV_ADDMULTI 0x02 /* add, pretending it has been added already */
+#define GV_ADDWARN 0x04 /* add, but warn if symbol wasn't already there */
+#define GV_ADDINEVAL 0x08 /* add, as though we're doing so within an eval */
+#define GV_NOINIT 0x10 /* add, but don't init symbol, if type != PVGV */
/* XXX see note in pp_entereval() for why we forgo typo
warnings if the symbol must be introduced in an eval.
GSAR 96-10-12 */
- gv_fetchpv(s, in_eval ? (GV_ADDMULTI | 8) : TRUE,
+ gv_fetchpv(s, in_eval ? (GV_ADDMULTI | GV_ADDINEVAL) : TRUE,
kind == '$' ? SVt_PV :
kind == '@' ? SVt_PVAV :
kind == '%' ? SVt_PVHV :
/* build ops for a bareword */
yylval.opval = (OP*)newSVOP(OP_CONST, 0, newSVpv(tokenbuf+1, 0));
yylval.opval->op_private = OPpCONST_ENTERED;
- gv_fetchpv(tokenbuf+1, in_eval ? (GV_ADDMULTI | 8) : TRUE,
+ gv_fetchpv(tokenbuf+1, in_eval ? (GV_ADDMULTI | GV_ADDINEVAL) : TRUE,
((tokenbuf[0] == '$') ? SVt_PV
: (tokenbuf[0] == '@') ? SVt_PVAV
: SVt_PVHV));