
perlbug-comment at perl
Aug 18, 2012, 2:24 PM
Post #4 of 9
(107 views)
Permalink
|
|
[perl #114040] Multiline constructs in regexp blocks
[In reply to]
|
|
On Fri Aug 17 14:34:10 2012, sprout wrote: > On Mon Jul 09 06:29:12 2012, davem wrote: > > On Sun, Jul 08, 2012 at 02:18:36PM -0700, Father Chrysostomos wrote: > > > These all fail to parse with bleadperl, but work in 5.16: > > [snip] > > > /(?{ <<END > > > END > > > })/; > > > > Note that the bleadperl change just made literal (?{}) be handled > > similarly to how array and hash indexes have always been parsed in > > interpolating strings. So this fails, and always has: > > > > qq[.$a{ do { > > <<END > > foo > > END > > }}]; > > This is actually a hard one. This works, and always has: > > s//<<END > /e; > blah blah blah > END > > I seem to remember writing code that relies on that, too. > > These work, too: > > s/${ <<END > }//; > blah blah blah > END > > m/${ <<END > }/; > blah blah blah > END > > "${ <<END > }"; > noet oteuhhnto e > END > > For consistency with historical behaviour, we would have to make this work: > > /(?{ <<END > })/ > oentuh oenuth > END > But those don’t work in string eval. In fact, they crash in every version from 5.6.2 to 5.17.3. So is the solution to break the examples above and make deer hocks work the way they are documented? s//<<end blah blah blah end /e; -- Father Chrysostomos
|