diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-06-20 17:22:15 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-06-20 17:22:15 +0000 |
commit | 9badc3612459020624c762b543ab7dd82718f170 (patch) | |
tree | 6edcde947ccb900797f972f1328f291e35b35bf3 /toke.c | |
parent | 1387f30c3a0e2c0d15467578b3cb17d441a9efff (diff) | |
download | perl-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |