diff options
author | Zefram <zefram@fysh.org> | 2009-08-21 01:49:14 +0200 |
---|---|---|
committer | Vincent Pit <perl@profvince.com> | 2009-08-21 13:33:59 +0200 |
commit | f747ebd621ca5f8cd5605b35b81db4ac486f68f9 (patch) | |
tree | e412ad370ee591c40096e9d87a3aa30ac7b6b269 /cop.h | |
parent | a8ae8fee103e29c80450bb74b87866088a24b4a1 (diff) | |
download | perl-f747ebd621ca5f8cd5605b35b81db4ac486f68f9.tar.gz |
Add clear magic to %^H so that the HE chain is reset when you empty it.
This fixes [perl #68590] : %^H not lexical enough.
Diffstat (limited to 'cop.h')
-rw-r--r-- | cop.h | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -246,12 +246,17 @@ struct cop { #define CopARYBASE_set(c, b) STMT_START { \ if (b || ((c)->cop_hints & HINT_ARYBASE)) { \ (c)->cop_hints |= HINT_ARYBASE; \ - if ((c) == &PL_compiling) \ - PL_hints |= HINT_LOCALIZE_HH | HINT_ARYBASE; \ - (c)->cop_hints_hash \ - = Perl_refcounted_he_new(aTHX_ (c)->cop_hints_hash, \ + if ((c) == &PL_compiling) { \ + SV *val = newSViv(b); \ + (void)hv_stores(GvHV(PL_hintgv), "$[", val); \ + mg_set(val); \ + PL_hints |= HINT_ARYBASE; \ + } else { \ + (c)->cop_hints_hash \ + = Perl_refcounted_he_new(aTHX_ (c)->cop_hints_hash, \ newSVpvs_flags("$[", SVs_TEMP), \ sv_2mortal(newSViv(b))); \ + } \ } \ } STMT_END |