[perl #133772] stringification of regex with variables
[email protected] (Lars D????????????????? ?????????) Wed, 16 Jan 2019 08:46:22 -0800
| Newsgroups | perl.perl6.compiler |
|---|---|
| Message-ID | <[email protected]> |
# New Ticket Created by Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯
# Please include the string: [perl #133772]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=133772 >
rpm -qi rakudo | rg Version
Version : 2018.12
my Str $s = 'abc';
my @l = $s.comb.map(-> $g { /$g/ });
# time passes
@l.perl.say
Expect:
[/a/, /b/, /c/]
Got:
[/$g/, /$g/, /$g/]
The generated regexes do work, they just display wrong/useless. At the time I inspect the data structure, $g had been assigned multiple times with varying values and is long already out of scope.