This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #70151] eval localises %^H at runtime
authorFather Chrysostomos <sprout@cpan.org>
Thu, 17 Nov 2011 02:18:23 +0000 (18:18 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 17 Nov 2011 17:18:02 +0000 (09:18 -0800)
commitf45b078d20e995d83ee8428c8f199c0e6eca92f9
treec476f930761d33da5ed9c9217afd196d394c7e10
parent3973654ea25ef9a4fe80b488debf904c3291a92d
[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.
embed.fnc
embed.h
pp_ctl.c
proto.h
t/comp/hints.t
t/comp/require.t
t/op/eval.t