diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-19 23:11:12 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-19 23:11:12 +0000 |
commit | 0282be9287c81efde41d8df3c62f1c95bb459498 (patch) | |
tree | 2035bee321e1f2d0d35ddcdf2b71da025e4796ab /op.c | |
parent | 696814337d4eac8d0663d5307d6e01964d1b2897 (diff) | |
download | perl-0282be9287c81efde41d8df3c62f1c95bb459498.tar.gz |
Let %^H be modifiable in eval-strings (bug #41531),
by adding a meaning for OPf_SPECIAL on OP_CONST.
Patch by Yves Orton.
p4raw-id: //depot/perl@30644
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -6037,8 +6037,11 @@ Perl_ck_eval(pTHX_ OP *o) } o->op_targ = (PADOFFSET)PL_hints; if ((PL_hints & HINT_LOCALIZE_HH) != 0 && GvHV(PL_hintgv)) { - /* Store a copy of %^H that pp_entereval can pick up */ - OP *hhop = newSVOP(OP_CONST, 0, + /* Store a copy of %^H that pp_entereval can pick up. + OPf_SPECIAL flags the opcode as being for this purpose, + so that it in turn will return a copy at every + eval.*/ + OP *hhop = newSVOP(OP_CONST, OPf_SPECIAL, (SV*)Perl_hv_copy_hints_hv(aTHX_ GvHV(PL_hintgv))); cUNOPo->op_first->op_sibling = hhop; o->op_private |= OPpEVAL_HAS_HH; |