summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-02-03 19:41:11 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-02-03 19:41:11 +0000
commit59f00321bbc2d04656a65e0e9ccbbd93a8708e71 (patch)
treec0f54dac647290fc40828259685a2859be908403 /pp_hot.c
parent81e59e001862de98bd8263eb307b4c909c0b16b8 (diff)
downloadperl-59f00321bbc2d04656a65e0e9ccbbd93a8708e71.tar.gz
Implement "my $_".
p4raw-id: //depot/perl@22263
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 1dffe945c5..e884e2dbe1 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1195,6 +1195,8 @@ PP(pp_match)
if (PL_op->op_flags & OPf_STACKED)
TARG = POPs;
+ else if (PL_op->op_private & OPpTARGET_MY)
+ GETTARGET;
else {
TARG = DEFSV;
EXTEND(SP,1);
@@ -1958,6 +1960,8 @@ PP(pp_subst)
dstr = (pm->op_pmflags & PMf_CONST) ? POPs : Nullsv;
if (PL_op->op_flags & OPf_STACKED)
TARG = POPs;
+ else if (PL_op->op_private & OPpTARGET_MY)
+ GETTARGET;
else {
TARG = DEFSV;
EXTEND(SP,1);
@@ -2305,7 +2309,10 @@ PP(pp_grepwhile)
src = PL_stack_base[*PL_markstack_ptr];
SvTEMP_off(src);
- DEFSV = src;
+ if (PL_op->op_private & OPpGREP_LEX)
+ PAD_SVl(PL_op->op_targ) = src;
+ else
+ DEFSV = src;
RETURNOP(cLOGOP->op_other);
}