diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-11-16 18:18:23 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-17 09:18:02 -0800 |
commit | f45b078d20e995d83ee8428c8f199c0e6eca92f9 (patch) | |
tree | c476f930761d33da5ed9c9217afd196d394c7e10 /proto.h | |
parent | 3973654ea25ef9a4fe80b488debf904c3291a92d (diff) | |
download | perl-f45b078d20e995d83ee8428c8f199c0e6eca92f9.tar.gz |
[perl #70151] eval localises %^H at runtime
It doesn’t any more.
Now the hints are localised in a separate inner scope surrounding the
call to yyparse. This meant moving hint-handling code from pp_require
and pp_entereval into S_doeval.
Some tests in t/comp/hints.t were testing for the buggy behaviour, so
they have been adjusted.
Basically, this fixes
sub import {
eval "strict->import"
}
which should work the same way as
sub import {
strict->import
}
but was not working because %^H and $^H were being localised to
the eval at its run time, not just its compilation. So the values
assigned to %^H and $^H at the eval’s run time would simply be lost.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -5909,7 +5909,7 @@ STATIC OP* S_do_smartmatch(pTHX_ HV* seen_this, HV* seen_other, const bool copie STATIC OP* S_docatch(pTHX_ OP *o) __attribute__warn_unused_result__; -STATIC bool S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq); +STATIC bool S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq, HV* hh); STATIC OP* S_dofindlabel(pTHX_ OP *o, const char *label, OP **opstack, OP **oplimit) __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1) |