summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-06-20 17:22:15 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-06-20 17:22:15 +0000
commit9badc3612459020624c762b543ab7dd82718f170 (patch)
tree6edcde947ccb900797f972f1328f291e35b35bf3 /toke.c
parent1387f30c3a0e2c0d15467578b3cb17d441a9efff (diff)
downloadperl-9badc3612459020624c762b543ab7dd82718f170.tar.gz
Change 28404 broke the construct s/foo/<<BAR/e. So, try to be more
clever. If the right hand side of s///e contains a #, then maybe it's a comment, so add a \n after it. Obviously, this is fast, but won't cover all possible cases. p4raw-id: //depot/perl@28409
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index 4eef362ae5..ebb3550757 100644
--- a/toke.c
+++ b/toke.c
@@ -10720,7 +10720,9 @@ S_scan_subst(pTHX_ char *start)
sv_catpv(repl, es ? "eval " : "do ");
sv_catpvs(repl, "{");
sv_catsv(repl, PL_lex_repl);
- sv_catpvs(repl, "\n}");
+ if (strchr(SvPVX(PL_lex_repl), '#'))
+ sv_catpvs(repl, "\n");
+ sv_catpvs(repl, "}");
SvEVALED_on(repl);
SvREFCNT_dec(PL_lex_repl);
PL_lex_repl = repl;