FAQ

On Mon May 30 05:08:27 2016, davem wrote:
On Mon, May 23, 2016 at 10:48:26AM -0700, Daniel Șuteu wrote:
my $str = "foo";
$str =~ /(?{ s{}{} })/;
As has been pointed out elsewhere in this ticket, an empty pattern
is interpreted as the "last successful match". The re-eval
mechanism takes this as being the currently executing pattern,
and so you get infinite recursion.

Marking the currently executing pattern as 'last successful'
is necessary within an re-eval so that things like $1 are visible:

#prints "a"
"ab" =~ /(.)(?{ print "[$1]\n" })/;
Does the last-successful-match logic use PL_curpm?

--

Father Chrysostomos


---
via perlbug: queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=128225

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 13 of 16 | next ›
Discussion Overview
groupperl5-porters @
categoriesperl
postedMay 23, '16 at 5:48p
activeMay 30, '16 at 9:13p
posts16
users5
websiteperl.org

People

Translate

site design / logo © 2017 Grokbase