# New Ticket Created by Alex Jakimenko
# Please include the string: [perl #127672]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=127672 >
Code:
say gather ‘abc’ ~~ m:g/ . {take ‘X’} /
Result:
(X)
I expected to get three X-s, but I only got the first one (like if it lost :g).
However, if you just 「say」 it, then you get the right result:
‘abc’ ~~ m:g/ . {say ‘X’} /
Result:
X
X
X
Same problem with exhaustive:
say gather ‘abc’ ~~ m:ex/ .+? {take ‘X’} /
Result:
(X)
Interestingly, backtracking works as expected:
say gather ‘bc’ ~~ m/(.)* {take ‘X’} ‘c’ /
Result:
(X X)