diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-20 14:55:09 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-21 14:11:02 -0700 |
commit | 043cc6c601c03ac1644cea26a20b39eb34957445 (patch) | |
tree | d460ea31424c8d44bd08002fba09ba7f37a334df /t/base | |
parent | 565b52dfca4375468541e36d53e8a2aba372c056 (diff) | |
download | perl-043cc6c601c03ac1644cea26a20b39eb34957445.tar.gz |
here-doc in quotes in multiline s//.../e in eval
When <<END occurs on the last line of a quote-like operator inside a
string eval ("${\<<END}"), it peeks into the linestr buffer of the
parent lexing scope (quote-like operators start a new lexing scope
with the linestr buffer containing what is between the quotes) to find
the body of the here-doc. It modifies that buffer, stealing however
much it needs.
It was not leaving things in the consistent state that s///e checks
for when it finishes parsing the replacement (to make sure s//}+{/
doesn’t ‘work’). Specifically, it was not shrinking the parent buf-
fer, so when PL_bufend was reset in sublex_done to the end of the par-
ent buffer, it was pointing to the wrong spot.
Diffstat (limited to 't/base')
-rw-r--r-- | t/base/lex.t | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/t/base/lex.t b/t/base/lex.t index d55b189bfa..559cc30021 100644 --- a/t/base/lex.t +++ b/t/base/lex.t @@ -1,6 +1,6 @@ #!./perl -print "1..58\n"; +print "1..59\n"; $x = 'x'; @@ -280,3 +280,11 @@ ok 58 - heredoc after "" in s/// in eval END '; print $_ || "not ok 58\n"; + +$_ = ""; +eval 's|(?:)|"${\<<\END}" +ok 59 - heredoc in "" in multiline s///e in eval +END +|e +'; +print $_ || "not ok 59\n"; |