[perl #131243] [REGEX] Interpolating a Hash in a regex treats it as a list and errors out
On Tue, 02 May 2017 08:35:34 -0700, c...@zoffix.com wrote: > Both of these forms produce the error below > > my %stuff = ; > say 'foo bar meows' ~~ m:g/ %stuff\S+ /; > say 'foo bar meows' ~~ m:g/ %() \S+ /; > > # P6opaque: no such attribute '$!reified' in type List when trying to > get > # a value in block at z2.p6 line 8 > > What did I expect to happen? No idea, I just randomly tried the code. > If it's not meant to work then at least a better error should be > shown. S05 says¹: The use of a hash variable in patterns is reserved. So yes, this should be made to throw a nicer error. --- [1] http://design.perl6.org/S05.html#Variable_(non-)interpolation
[perl #131243] [REGEX] Interpolating a Hash in a regex treats it as a list and errors out
# New Ticket Created by Zoffix Znet # Please include the string: [perl #131243] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=131243 > Both of these forms produce the error below my %stuff = ; say 'foo bar meows' ~~ m:g/ %stuff\S+ /; say 'foo bar meows' ~~ m:g/ %() \S+ /; # P6opaque: no such attribute '$!reified' in type List when trying to get # a value in block at z2.p6 line 8 What did I expect to happen? No idea, I just randomly tried the code. If it's not meant to work then at least a better error should be shown.