summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-21 18:28:22 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-21 18:28:22 +0000
commit54b9620dd49f76536ba0792f6f471615a414bd6a (patch)
tree0f7080854c047d90b09822aec3b81dd2fcbabd89 /pp_ctl.c
parentff2faa2b5a0809a5124aa90fc1d07503e49a73fb (diff)
downloadperl-54b9620dd49f76536ba0792f6f471615a414bd6a.tar.gz
$_ is now per-thread (rather a lot of changes). Only tested under
*-linux-thread at the moment. p4raw-id: //depot/perl@274
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 8691cfa053..f5454ec3ed 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -546,14 +546,17 @@ PP(pp_grepstart)
ENTER; /* enter outer scope */
SAVETMPS;
- SAVESPTR(GvSV(defgv));
-
+#if 0
+ SAVE_DEFSV;
+#else
+ save_sptr(av_fetch(thr->threadsv, find_threadsv("_"), FALSE));
+#endif
ENTER; /* enter inner scope */
SAVESPTR(curpm);
src = stack_base[*markstack_ptr];
SvTEMP_off(src);
- GvSV(defgv) = src;
+ DEFSV = src;
PUTBACK;
if (op->op_type == OP_MAPSTART)
@@ -623,7 +626,7 @@ PP(pp_mapwhile)
src = stack_base[markstack_ptr[-1]];
SvTEMP_off(src);
- GvSV(defgv) = src;
+ DEFSV = src;
RETURNOP(cLOGOP->op_other);
}
@@ -1334,12 +1337,19 @@ PP(pp_enteriter)
ENTER;
SAVETMPS;
- if (op->op_targ)
- svp = &curpad[op->op_targ]; /* "my" variable */
+#ifdef USE_THREADS
+ if (op->op_flags & OPf_SPECIAL)
+ svp = save_threadsv(op->op_targ); /* per-thread variable */
else
+#endif /* USE_THREADS */
+ if (op->op_targ) {
+ svp = &curpad[op->op_targ]; /* "my" variable */
+ SAVESPTR(*svp);
+ }
+ else {
svp = &GvSV((GV*)POPs); /* symbol table variable */
-
- SAVESPTR(*svp);
+ SAVESPTR(*svp);
+ }
ENTER;