summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Carter <bcarter@gumdrop.flyinganvil.org>2006-06-08 19:08:44 -0700
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-06-20 08:52:12 +0000
commit2d997502fd695609fa2064523de2ba2d8d094b6c (patch)
tree4417053f95582b818069a8af517b33d99412e3b5
parent7d1bbbe8b54b3a128fb15bc6b5a4682e0cbf915b (diff)
downloadperl-2d997502fd695609fa2064523de2ba2d8d094b6c.tar.gz
[perl #39365] Bug in toke.c (eval in subst)
From: bcarter@gumdrop.flyinganvil.org (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.0.11-39365-134716.18.9775670722527@perl.org> plus a regression test. p4raw-id: //depot/perl@28404
-rw-r--r--t/comp/parser.t5
-rw-r--r--toke.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t
index 439dc71a1d..e1eff35c11 100644
--- a/t/comp/parser.t
+++ b/t/comp/parser.t
@@ -9,7 +9,7 @@ BEGIN {
}
require "./test.pl";
-plan( tests => 59 );
+plan( tests => 60 );
eval '%@x=0;';
like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' );
@@ -207,3 +207,6 @@ like( $@, qr/Bad name after foo'/, 'Bad name after foo\'' );
# test for ?: context error
eval q{($a ? $x : ($y)) = 5};
like( $@, qr/Assignment to both a list and a scalar/, 'Assignment to both a list and a scalar' );
+
+eval q{ s/x/#/e };
+is( $@, '', 'comments in s///e' );
diff --git a/toke.c b/toke.c
index 988b2694a9..4eef362ae5 100644
--- a/toke.c
+++ b/toke.c
@@ -10720,7 +10720,7 @@ S_scan_subst(pTHX_ char *start)
sv_catpv(repl, es ? "eval " : "do ");
sv_catpvs(repl, "{");
sv_catsv(repl, PL_lex_repl);
- sv_catpvs(repl, "}");
+ sv_catpvs(repl, "\n}");
SvEVALED_on(repl);
SvREFCNT_dec(PL_lex_repl);
PL_lex_repl = repl;