This variable stores the length of the word we are parsing. But at
one point it starts being used as a boolean to indicate that we have a
bareword ending in two colons. So if are looking up are bareword that
does not end in ::, we have to call strlen() to scan the string and
determine the length.
lastchar && PL_bufptr - 2 >= PL_linestart
? PL_bufptr[-2]
: 0;
+ bool safebw;
/* Get the rest if it looks like a package qualifier */
PL_tokenbuf[len] = '\0';
gv = NULL;
gvp = 0;
+ safebw = TRUE;
}
else {
if (!lex && !gv) {
GV_NOADD_NOINIT | ( UTF ? SVf_UTF8 : 0 ),
SVt_PVCV);
}
- len = 0;
+ safebw = FALSE;
}
/* if we saw a global override before, get the right name */
if (!sv)
sv = S_newSV_maybe_utf8(aTHX_ PL_tokenbuf,
- len ? len : strlen(PL_tokenbuf));
+ len);
if (gvp) {
SV * const tmp_sv = sv;
sv = newSVpvs("CORE::GLOBAL::");
pl_yylval.opval->op_private = OPpCONST_BARE;
/* And if "Foo::", then that's what it certainly is. */
- if (len)
+ if (safebw)
goto safe_bareword;
if (!off)