diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-06 01:33:31 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-06 01:33:31 +0000 |
commit | 2090ab20212398e485f20cd7e50303dcd3601be7 (patch) | |
tree | 968f397721d6fa6e8d901eb28b793a71bdabc288 /t | |
parent | 758e67a87e10a9deb9b76152119daf8ca2aa6267 (diff) | |
download | perl-2090ab20212398e485f20cd7e50303dcd3601be7.tar.gz |
Integrate change #10448 from maintperl; lexicals
outside an eval"" weren't resolved correctly inside a subroutine
definition inside the eval"" if they were not already referenced
in the toplevel of the eval""-ed code
p4raw-link: @10448 on //depot/maint-5.6/perl: 332ba4f98bc63c81fd7ba0d06432a7f903d716cf
p4raw-id: //depot/perl@10449
p4raw-integrated: from //depot/maint-5.6/perl@10447 'merge in' cop.h
(@9288..) t/op/misc.t (@10394..) op.c pp_ctl.c (@10412..)
Diffstat (limited to 't')
-rwxr-xr-x | t/op/misc.t | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/op/misc.t b/t/op/misc.t index 8e67b6144b..881f99dc18 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -587,6 +587,18 @@ EXPECT ok 1 ok 2 ######## +# lexicals outside an eval"" should be visible inside subroutine definitions +# within it +eval <<'EOT'; die $@ if $@; +{ + my $X = "ok\n"; + eval 'sub Y { print $X }'; die $@ if $@; + Y(); +} +EOT +EXPECT +ok +######## # This test is here instead of pragma/locale.t because # the bug depends on in the internal state of the locale # settings and pragma/locale messes up that state pretty badly. |