summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perly.c4
-rw-r--r--perly.y4
-rwxr-xr-xt/op/misc.t12
-rw-r--r--t/pragma/warn/universal2
-rw-r--r--vms/perly_c.vms4
5 files changed, 18 insertions, 8 deletions
diff --git a/perly.c b/perly.c
index 35f64e9d48..2c63b52e47 100644
--- a/perly.c
+++ b/perly.c
@@ -1570,12 +1570,12 @@ case 1:
#if defined(YYDEBUG) && defined(DEBUGGING)
yydebug = (DEBUG_p_TEST);
#endif
- PL_expect = XSTATE;
+ PL_expect = XSTATE; yyval.ival = block_start(TRUE);
}
break;
case 2:
#line 135 "perly.y"
-{ newPROG(yyvsp[0].opval); }
+{ newPROG(block_end(yyvsp[-1].ival,yyvsp[0].opval)); }
break;
case 3:
#line 139 "perly.y"
diff --git a/perly.y b/perly.y
index a30f4cea7e..c682c9cc4e 100644
--- a/perly.y
+++ b/perly.y
@@ -129,10 +129,10 @@ prog : /* NULL */
#if defined(YYDEBUG) && defined(DEBUGGING)
yydebug = (DEBUG_p_TEST);
#endif
- PL_expect = XSTATE;
+ PL_expect = XSTATE; $$ = block_start(TRUE);
}
/*CONTINUED*/ lineseq
- { newPROG($2); }
+ { newPROG(block_end($1,$2)); }
;
block : '{' remember lineseq '}'
diff --git a/t/op/misc.t b/t/op/misc.t
index 90df19a420..4b4d8031d4 100755
--- a/t/op/misc.t
+++ b/t/op/misc.t
@@ -575,6 +575,18 @@ print qw(ab a\b a\\b);
EXPECT
aba\ba\b
########
+# lexicals declared after the myeval() definition should not be visible
+# within it
+sub myeval { eval $_[0] }
+my $foo = "ok 2\n";
+myeval('sub foo { local $foo = "ok 1\n"; print $foo; }');
+die $@ if $@;
+foo();
+print $foo;
+EXPECT
+ok 1
+ok 2
+########
# 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.
diff --git a/t/pragma/warn/universal b/t/pragma/warn/universal
index 6dbb1be4e0..d9b1883532 100644
--- a/t/pragma/warn/universal
+++ b/t/pragma/warn/universal
@@ -12,5 +12,3 @@ my $a = bless [] ;
UNIVERSAL::isa $a, Jim ;
EXPECT
Can't locate package Joe for @main::ISA at - line 5.
-Can't locate package Joe for @main::ISA.
-Can't locate package Joe for @main::ISA.
diff --git a/vms/perly_c.vms b/vms/perly_c.vms
index b515dd17a5..7d071a0020 100644
--- a/vms/perly_c.vms
+++ b/vms/perly_c.vms
@@ -1572,12 +1572,12 @@ case 1:
#if defined(YYDEBUG) && defined(DEBUGGING)
yydebug = (DEBUG_p_TEST);
#endif
- PL_expect = XSTATE;
+ PL_expect = XSTATE; yyval.ival = block_start(TRUE);
}
break;
case 2:
#line 135 "perly.y"
-{ newPROG(yyvsp[0].opval); }
+{ newPROG(block_end(yyvsp[-1].ival,yyvsp[0].opval)); }
break;
case 3:
#line 139 "perly.y"