In Quoting constructs§
See primary documentation in context for Word quoting with interpolation: qqw
The qw
form of word quoting doesn't interpolate variables:
my = 42; say qw{$a b c}; # OUTPUT: «$a b c»
Thus, if you wish for variables to be interpolated within the quoted string, you need to use the qqw
variant:
my = 42;my = qqw{$a b c};say ; # OUTPUT: «[42 b c]»
Note that variable interpolation happens before word splitting:
my = "a b";my = qqw{$a c};.say for ; # OUTPUT: «abc»