S_gv_ename(pTHX_ GV *gv)
{
SV* const tmpsv = sv_newmortal();
- gv_efullname3(tmpsv, gv, Nullch);
+ gv_efullname3(tmpsv, gv, NULL);
return SvPV_nolen_const(tmpsv);
}
}
#else
SvREFCNT_dec(cSVOPo->op_sv);
- cSVOPo->op_sv = Nullsv;
+ cSVOPo->op_sv = NULL;
#endif
}
break;
case OP_METHOD_NAMED:
case OP_CONST:
SvREFCNT_dec(cSVOPo->op_sv);
- cSVOPo->op_sv = Nullsv;
+ cSVOPo->op_sv = NULL;
#ifdef USE_ITHREADS
/** Bug #15654
Even if op_clear does a pad_free for the target of the op,
case OP_TRANS:
if (o->op_private & (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF)) {
SvREFCNT_dec(cSVOPo->op_sv);
- cSVOPo->op_sv = Nullsv;
+ cSVOPo->op_sv = NULL;
}
else {
Safefree(cPVOPo->op_pv);
- cPVOPo->op_pv = Nullch;
+ cPVOPo->op_pv = NULL;
}
break;
case OP_SUBST:
case OP_CONST:
if (!(o->op_private & (OPpCONST_ARYBASE)))
goto nomod;
+ localize = 0;
if (PL_eval_start && PL_eval_start->op_type == OP_CONST) {
PL_compiling.cop_arybase = (I32)SvIV(cSVOPx(PL_eval_start)->op_sv);
PL_eval_start = 0;
/* FALL THROUGH */
default:
nomod:
- /* grep, foreach, subcalls, refgen, m//g */
- if (type == OP_GREPSTART || type == OP_ENTERSUB || type == OP_REFGEN
- || type == OP_MATCH)
+ /* grep, foreach, subcalls, refgen */
+ if (type == OP_GREPSTART || type == OP_ENTERSUB || type == OP_REFGEN)
break;
yyerror(Perl_form(aTHX_ "Can't modify %s in %s",
(o->op_type == OP_NULL && (o->op_flags & OPf_SPECIAL)
Perl_load_module(aTHX_ PERL_LOADMOD_IMPORT_OPS,
newSVpvs(ATTRSMODULE),
- Nullsv, prepend_elem(OP_LIST,
+ NULL, prepend_elem(OP_LIST,
newSVOP(OP_CONST, 0, newSVpv(stashpv,0)),
prepend_elem(OP_LIST,
newSVOP(OP_CONST, 0,
}
if (!(right->op_flags & OPf_STACKED) && ismatchop) {
right->op_flags |= OPf_STACKED;
- /* s/// and tr/// modify their arg.
- * m//g also indirectly modifies the arg by setting pos magic on it */
- if ( (right->op_type == OP_MATCH &&
- (cPMOPx(right)->op_pmflags & PMf_GLOBAL))
- || (right->op_type == OP_SUBST)
- || (right->op_type == OP_TRANS &&
- ! (right->op_private & OPpTRANS_IDENTICAL))
- )
+ if (right->op_type != OP_MATCH &&
+ ! (right->op_type == OP_TRANS &&
+ right->op_private & OPpTRANS_IDENTICAL))
left = mod(left, right->op_type);
if (right->op_type == OP_TRANS)
o = newBINOP(OP_NULL, OPf_STACKED, scalar(left), right);
Perl_jmaybe(pTHX_ OP *o)
{
if (o->op_type == OP_LIST) {
- OP * const o2 = newSVREF(newGVOP(OP_GV, 0, gv_fetchpv(";", GV_ADD, SVt_PV)));
+ OP * const o2
+ = newSVREF(newGVOP(OP_GV, 0, gv_fetchpvs(";", GV_ADD|GV_NOTQUAL,
+ SVt_PV)));
o = convert(OP_JOIN, 0, prepend_elem(OP_LIST, o2, o));
}
return o;
Nullop,
append_elem(OP_LINESEQ,
append_elem(OP_LINESEQ,
- newSTATEOP(0, Nullch, newUNOP(OP_REQUIRE, 0, idop)),
- newSTATEOP(0, Nullch, veop)),
- newSTATEOP(0, Nullch, imop) ));
+ newSTATEOP(0, NULL, newUNOP(OP_REQUIRE, 0, idop)),
+ newSTATEOP(0, NULL, veop)),
+ newSTATEOP(0, NULL, imop) ));
/* The "did you use incorrect case?" warning used to be here.
* The problem is that on case-insensitive filesystems one
{
dVAR;
OP *doop;
- GV *gv = Nullgv;
+ GV *gv = NULL;
if (!force_builtin) {
- gv = gv_fetchpv("do", 0, SVt_PVCV);
+ gv = gv_fetchpvs("do", GV_NOTQUAL, SVt_PVCV);
if (!(gv && GvCVu(gv) && GvIMPORTED_CV(gv))) {
GV * const * const gvp = (GV**)hv_fetchs(PL_globalstash, "do", FALSE);
- gv = gvp ? *gvp : Nullgv;
+ gv = gvp ? *gvp : NULL;
}
}
cPADOPx(tmpop)->op_padix = 0; /* steal it */
#else
pm->op_pmreplroot = (OP*)cSVOPx(tmpop)->op_sv;
- cSVOPx(tmpop)->op_sv = Nullsv; /* steal it */
+ cSVOPx(tmpop)->op_sv = NULL; /* steal it */
#endif
pm->op_pmflags |= PMf_ONCE;
tmpop = cUNOPo->op_first; /* to list (nulled) */
LEAVE;
}
SvPOK_off((SV*)cv); /* forget prototype */
- CvGV(cv) = Nullgv;
+ CvGV(cv) = NULL;
pad_undef(cv);
if (!SvREFCNT(cv) && CvOUTSIDE(cv)) {
if (!CvWEAKOUTSIDE(cv))
SvREFCNT_dec(CvOUTSIDE(cv));
- CvOUTSIDE(cv) = Nullcv;
+ CvOUTSIDE(cv) = NULL;
}
if (CvCONST(cv)) {
SvREFCNT_dec((SV*)CvXSUBANY(cv).any_ptr);
{
if (((!p != !SvPOK(cv)) || (p && strNE(p, SvPVX_const(cv)))) && ckWARN_d(WARN_PROTOTYPE)) {
SV* const msg = sv_newmortal();
- SV* name = Nullsv;
+ SV* name = NULL;
if (gv)
- gv_efullname3(name = sv_newmortal(), gv, Nullch);
+ gv_efullname3(name = sv_newmortal(), gv, NULL);
sv_setpv(msg, "Prototype mismatch:");
if (name)
Perl_sv_catpvf(aTHX_ msg, " sub %"SVf, name);
Perl_op_const_sv(pTHX_ const OP *o, CV *cv)
{
dVAR;
- SV *sv = Nullsv;
+ SV *sv = NULL;
if (!o)
- return Nullsv;
+ return NULL;
if (o->op_type == OP_LINESEQ && cLISTOPo->op_first)
o = cLISTOPo->op_first->op_sibling;
if (type == OP_LEAVESUB || type == OP_RETURN)
break;
if (sv)
- return Nullsv;
+ return NULL;
if (type == OP_CONST && cSVOPo->op_sv)
sv = cSVOPo->op_sv;
else if (cv && type == OP_CONST) {
sv = PAD_BASE_SV(CvPADLIST(cv), o->op_targ);
if (!sv)
- return Nullsv;
+ return NULL;
}
else if (cv && type == OP_PADSV) {
if (CvCONST(cv)) { /* newly cloned anon */
/* the candidate should have 1 ref from this pad and 1 ref
* from the parent */
if (!sv || SvREFCNT(sv) != 2)
- return Nullsv;
+ return NULL;
sv = newSVsv(sv);
SvREADONLY_on(sv);
return sv;
}
}
else {
- return Nullsv;
+ return NULL;
}
}
return sv;
const I32 gv_fetch_flags
= (block || attrs || (CvFLAGS(PL_compcv) & CVf_BUILTIN_ATTRS))
? GV_ADDMULTI : GV_ADDMULTI | GV_NOINIT;
- const char * const name = o ? SvPVx_nolen_const(cSVOPo->op_sv) : Nullch;
+ const char * const name = o ? SvPVx_nolen_const(cSVOPo->op_sv) : NULL;
if (proto) {
assert(proto->op_type == OP_CONST);
ps = SvPVx_const(((SVOP*)proto)->op_sv, ps_len);
}
else
- ps = Nullch;
+ ps = NULL;
if (!name && PERLDB_NAMEANON && CopLINE(PL_curcop)) {
SV * const sv = sv_newmortal();
aname = SvPVX_const(sv);
}
else
- aname = Nullch;
+ aname = NULL;
gv = name ? gv_fetchsv(cSVOPo->op_sv, gv_fetch_flags, SVt_PVCV)
: gv_fetchpv(aname ? aname
goto done;
}
- cv = (!name || GvCVGEN(gv)) ? Nullcv : GvCV(gv);
+ cv = (!name || GvCVGEN(gv)) ? NULL : GvCV(gv);
#ifdef GV_UNIQUE_CHECK
if (cv && GvUNIQUE(gv) && SvREADONLY(cv)) {
#endif
if (!block || !ps || *ps || attrs || (CvFLAGS(PL_compcv) & CVf_BUILTIN_ATTRS))
- const_sv = Nullsv;
+ const_sv = NULL;
else
- const_sv = op_const_sv(block, Nullcv);
+ const_sv = op_const_sv(block, NULL);
if (cv) {
const bool exists = CvROOT(cv) || CvXSUB(cv);
CopLINE_set(PL_curcop, oldline);
}
SvREFCNT_dec(cv);
- cv = Nullcv;
+ cv = NULL;
}
}
}
CvCONST_on(cv);
}
else {
- GvCV(gv) = Nullcv;
+ GvCV(gv) = NULL;
cv = newCONSTSUB(NULL, name, const_sv);
}
op_free(block);
/* This makes sub {}; work as expected. */
if (block->op_type == OP_STUB) {
op_free(block);
- block = newSTATEOP(0, Nullch, 0);
+ block = newSTATEOP(0, NULL, 0);
}
CvROOT(cv) = newUNOP(OP_LEAVESUB, 0, scalarseq(block));
}
const char * const tname = (name ? name : aname);
if (PERLDB_SUBLINE && PL_curstash != PL_debstash) {
- SV * const sv = NEWSV(0,0);
+ SV * const sv = newSV(0);
SV * const tmpstr = sv_newmortal();
- GV * const db_postponed = gv_fetchpv("DB::postponed", GV_ADDMULTI, SVt_PVHV);
+ GV * const db_postponed = gv_fetchpvs("DB::postponed",
+ GV_ADDMULTI, SVt_PVHV);
HV *hv;
Perl_sv_setpvf(aTHX_ sv, "%s:%ld-%ld",
CopFILE(PL_curcop),
(long)PL_subline, (long)CopLINE(PL_curcop));
- gv_efullname3(tmpstr, gv, Nullch);
+ gv_efullname3(tmpstr, gv, NULL);
hv_store(GvHV(PL_DBsub), SvPVX_const(tmpstr), SvCUR(tmpstr), sv, 0);
hv = GvHVn(db_postponed);
if (HvFILL(hv) > 0 && hv_exists(hv, SvPVX_const(tmpstr), SvCUR(tmpstr))) {
if (!subaddr)
Perl_croak(aTHX_ "panic: no address for '%s' in '%s'", name, filename);
- if ((cv = (name ? GvCV(gv) : Nullcv))) {
+ if ((cv = (name ? GvCV(gv) : NULL))) {
if (GvCVGEN(gv)) {
/* just a cached method */
SvREFCNT_dec(cv);
- cv = Nullcv;
+ cv = NULL;
}
else if (CvROOT(cv) || CvXSUB(cv) || GvASSUMECV(gv)) {
/* already defined (or promised) */
}
}
SvREFCNT_dec(cv);
- cv = Nullcv;
+ cv = NULL;
}
}
if (cv) /* must reuse cv if autoloaded */
cv_undef(cv);
else {
- cv = (CV*)NEWSV(1105,0);
+ cv = (CV*)newSV(0);
sv_upgrade((SV *)cv, SVt_PVCV);
if (name) {
GvCV(gv) = cv;
GV * const gv = o
? gv_fetchsv(cSVOPo->op_sv, GV_ADD, SVt_PVFM)
- : gv_fetchpv("STDOUT", GV_ADD, SVt_PVFM);
+ : gv_fetchpvs("STDOUT", GV_ADD|GV_NOTQUAL, SVt_PVFM);
#ifdef GV_UNIQUE_CHECK
if (GvUNIQUE(gv)) {
Perl_ck_anoncode(pTHX_ OP *o)
{
cSVOPo->op_targ = pad_add_anon(cSVOPo->op_sv, o->op_type);
- cSVOPo->op_sv = Nullsv;
+ cSVOPo->op_sv = NULL;
return o;
}
if (SvROK(kidsv) && SvREADONLY(kidsv)) {
SV * const rsv = SvRV(kidsv);
const int svtype = SvTYPE(rsv);
- const char *badtype = Nullch;
+ const char *badtype = NULL;
switch (o->op_type) {
case OP_RV2SV:
o->op_private &= ~HINT_STRICT_REFS;
}
if ((o->op_private & HINT_STRICT_REFS) && (kid->op_private & OPpCONST_BARE)) {
- const char *badthing = Nullch;
+ const char *badthing = NULL;
switch (o->op_type) {
case OP_RV2SV:
badthing = "a SCALAR";
/* is this op a FH constructor? */
if (is_handle_constructor(o,numargs)) {
- const char *name = Nullch;
+ const char *name = NULL;
STRLEN len = 0;
flags = 0;
OP *op = ((BINOP*)kid)->op_first;
name = NULL;
if (op) {
- SV *tmpstr = Nullsv;
+ SV *tmpstr = NULL;
const char * const a =
kid->op_type == OP_AELEM ?
"[]" : "{}";
if ((o->op_flags & OPf_KIDS) && !cLISTOPo->op_first->op_sibling)
append_elem(OP_GLOB, o, newDEFSVOP());
- if (!((gv = gv_fetchpv("glob", 0, SVt_PVCV))
+ if (!((gv = gv_fetchpvs("glob", GV_NOTQUAL, SVt_PVCV))
&& GvCVu(gv) && GvIMPORTED_CV(gv)))
{
- gv = gv_fetchpv("CORE::GLOBAL::glob", 0, SVt_PVCV);
+ gv = gv_fetchpvs("CORE::GLOBAL::glob", 0, SVt_PVCV);
}
#if !defined(PERL_EXTERNAL_GLOB)
GV *glob_gv;
ENTER;
Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT,
- newSVpvs("File::Glob"), Nullsv, Nullsv, Nullsv);
- gv = gv_fetchpv("CORE::GLOBAL::glob", 0, SVt_PVCV);
- glob_gv = gv_fetchpv("File::Glob::csh_glob", 0, SVt_PVCV);
+ newSVpvs("File::Glob"), NULL, NULL, NULL);
+ gv = gv_fetchpvs("CORE::GLOBAL::glob", 0, SVt_PVCV);
+ glob_gv = gv_fetchpvs("File::Glob::csh_glob", 0, SVt_PVCV);
GvCV(gv) = GvCV(glob_gv);
(void)SvREFCNT_inc((SV*)GvCV(gv));
GvIMPORTED_CV_on(gv);
sv = newSVpvn_share(method, SvCUR(sv), 0);
}
else {
- kSVOP->op_sv = Nullsv;
+ kSVOP->op_sv = NULL;
}
cmop = newSVOP(OP_METHOD_NAMED, 0, sv);
op_free(o);
Perl_ck_require(pTHX_ OP *o)
{
dVAR;
- GV* gv = Nullgv;
+ GV* gv = NULL;
if (o->op_flags & OPf_KIDS) { /* Shall we supply missing .pm? */
SVOP * const kid = (SVOP*)cUNOPo->op_first;
if (!(o->op_flags & OPf_SPECIAL)) { /* Wasn't written as CORE::require */
/* handle override, if any */
- gv = gv_fetchpv("require", 0, SVt_PVCV);
+ gv = gv_fetchpvs("require", GV_NOTQUAL, SVt_PVCV);
if (!(gv && GvCVu(gv) && GvIMPORTED_CV(gv))) {
GV * const * const gvp = (GV**)hv_fetchs(PL_globalstash, "require", FALSE);
- gv = gvp ? *gvp : Nullgv;
+ gv = gvp ? *gvp : NULL;
}
}
const char *gvname;
if (!(o->op_flags & OPf_STACKED))
return;
- GvMULTI_on(gv_fetchpv("a", GV_ADD, SVt_PV));
- GvMULTI_on(gv_fetchpv("b", GV_ADD, SVt_PV));
+ GvMULTI_on(gv_fetchpvs("a", GV_ADD|GV_NOTQUAL, SVt_PV));
+ GvMULTI_on(gv_fetchpvs("b", GV_ADD|GV_NOTQUAL, SVt_PV));
kid = kUNOP->op_first; /* get past null */
if (kid->op_type != OP_SCOPE)
return;
/* XXX I don't know how this isn't readonly already. */
SvREADONLY_on(PAD_SVl(ix));
}
- cSVOPo->op_sv = Nullsv;
+ cSVOPo->op_sv = NULL;
o->op_targ = ix;
}
#endif
if (SvTYPE(gv) == SVt_PVGV && GvCV(gv) && SvPVX_const(GvCV(gv))) {
/* XXX could check prototype here instead of just carping */
SV * const sv = sv_newmortal();
- gv_efullname3(sv, gv, Nullch);
+ gv_efullname3(sv, gv, NULL);
Perl_warner(aTHX_ packWARN(WARN_PROTOTYPE),
"%"SVf"() called too early to check prototype",
sv);