if (op->op_flags & OPf_MOD) {
if (op->op_private & OPpLVAL_INTRO)
SAVECLEARSV(curpad[op->op_targ]);
- else if (op->op_private & (OPpDEREF_HV|OPpDEREF_AV)) {
- SV* sv = curpad[op->op_targ];
- if (SvGMAGICAL(sv))
- mg_get(sv);
- if (!SvOK(sv)) {
- if (SvREADONLY(sv))
- croak(no_modify);
- (void)SvUPGRADE(sv, SVt_RV);
- SvRV(sv) = (op->op_private & OPpDEREF_HV ?
- (SV*)newHV() : (SV*)newAV());
- SvROK_on(sv);
- SvSETMAGIC(sv);
- }
- }
+ else if (op->op_private & (OPpDEREF_HV|OPpDEREF_AV))
+ provide_ref(op, curpad[op->op_targ]);
}
RETURN;
}
goto just_say_no;
if (IoFLAGS(io) & IOf_FLUSH)
- if (fflush(fp) == EOF)
+ if (Fflush(fp) == EOF)
goto just_say_no;
}
}
*(end++) = '\n'; *end = '\0';
for (cp = rstr; *cp; cp++) *cp = _tolower(*cp);
if (hasdir) {
- if (isunix) trim_unixpath(SvPVX(tmpglob),rstr);
+ if (isunix) trim_unixpath(rstr,SvPVX(tmpglob));
begin = rstr;
}
else {
DIE(no_helem, key);
if (op->op_private & OPpLVAL_INTRO)
save_svref(svp);
- else if (op->op_private & (OPpDEREF_HV|OPpDEREF_AV)) {
- SV* sv = *svp;
- if (SvGMAGICAL(sv))
- mg_get(sv);
- if (!SvOK(sv)) {
- (void)SvUPGRADE(sv, SVt_RV);
- SvRV(sv) = (op->op_private & OPpDEREF_HV ?
- (SV*)newHV() : (SV*)newAV());
- SvROK_on(sv);
- SvSETMAGIC(sv);
- }
- }
+ else if (op->op_private & (OPpDEREF_HV|OPpDEREF_AV))
+ provide_ref(op, *svp);
}
PUSHs(svp ? *svp : &sv_undef);
RETURN;
if ((op->op_private & OPpENTERSUB_DB) && !CvXSUB(cv)) {
sv = GvSV(DBsub);
save_item(sv);
- if (SvFLAGS(cv) & (SVpcv_ANON | SVpcv_CLONED)) /* Is GV potentially non-unique? */
+ if (CvFLAGS(cv) & (CVf_ANON | CVf_CLONED)) {
+ /* GV is potentially non-unique */
sv_setsv(sv, newRV((SV*)cv));
+ }
else {
gv = CvGV(cv);
gv_efullname(sv,gv);
DIE(no_aelem, elem);
if (op->op_private & OPpLVAL_INTRO)
save_svref(svp);
- else if (op->op_private & (OPpDEREF_HV|OPpDEREF_AV)) {
- SV* sv = *svp;
- if (SvGMAGICAL(sv))
- mg_get(sv);
- if (!SvOK(sv)) {
- (void)SvUPGRADE(sv, SVt_RV);
- SvRV(sv) = (op->op_private & OPpDEREF_HV ?
- (SV*)newHV() : (SV*)newAV());
- SvROK_on(sv);
- SvSETMAGIC(sv);
- }
- }
+ else if (op->op_private & (OPpDEREF_HV|OPpDEREF_AV))
+ provide_ref(op, *svp);
}
PUSHs(svp ? *svp : &sv_undef);
RETURN;
}
+void
+provide_ref(op, sv)
+OP* op;
+SV* sv;
+{
+ if (SvGMAGICAL(sv))
+ mg_get(sv);
+ if (!SvOK(sv)) {
+ if (SvREADONLY(sv))
+ croak(no_modify);
+ (void)SvUPGRADE(sv, SVt_RV);
+ SvRV(sv) = (op->op_private & OPpDEREF_HV ?
+ (SV*)newHV() : (SV*)newAV());
+ SvROK_on(sv);
+ SvSETMAGIC(sv);
+ }
+}
+
PP(pp_method)
{
dSP;