summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorRick Delaney <rick@consumercontact.com>2006-03-18 14:52:11 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-03-20 10:11:21 +0000
commit7a2e501a470d7096f8a5847c8002615db94d259b (patch)
treec4beabd1da817b736f2c9f96cac99f9ef7fe68ab /pp.c
parent4d743a9b1dd089ee06e7e583c66b2320c661183f (diff)
downloadperl-7a2e501a470d7096f8a5847c8002615db94d259b.tar.gz
Re: [perl #38710] localised stash slice
Message-ID: <20060319005211.GM25733@localhost.localdomain> One can now localize slices. p4raw-id: //depot/perl@27547
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/pp.c b/pp.c
index 7a9388388d..383b426f7c 100644
--- a/pp.c
+++ b/pp.c
@@ -3844,13 +3844,17 @@ PP(pp_hslice)
DIE(aTHX_ PL_no_helem_sv, keysv);
}
if (localizing) {
- if (preeminent)
- save_helem(hv, keysv, svp);
- else {
- STRLEN keylen;
- const char *key = SvPV_const(keysv, keylen);
- SAVEDELETE(hv, savepvn(key,keylen), keylen);
- }
+ if (HvNAME_get(hv) && isGV(*svp))
+ save_gp((GV*)*svp, !(PL_op->op_flags & OPf_SPECIAL));
+ else {
+ if (preeminent)
+ save_helem(hv, keysv, svp);
+ else {
+ STRLEN keylen;
+ const char *key = SvPV_const(keysv, keylen);
+ SAVEDELETE(hv, savepvn(key,keylen), keylen);
+ }
+ }
}
}
*MARK = svp ? *svp : &PL_sv_undef;