In Quoting constructs§
See primary documentation in context for Word quoting with interpolation and quote protection: qqww
The qqw
form of word quoting will treat quote characters literally, leaving them in the resulting words:
my = 42; say qqw{"$a b" c}.raku; # OUTPUT: «("\"42", "b\"", "c")»
Using the qqww
variant allows you to use quote characters for embedding strings in the word quoting structure:
my = 42; say qqww{"$a b" c}.raku; # OUTPUT: «("42 b", "c")»
The delimiters of embedded strings are always considered word splitters:
say qqww{'alpha'beta'gamma' 'delta'"epsilon"}.raku; # OUTPUT: «("alpha", "beta", "gamma", "delta", "epsilon")»
Unlike the qqw
form, interpolation also always splits (except for interpolation that takes place in an embedded string):
my = "now";= 'ni';my = qqww<$time$time "$_$_">;.say for ; # OUTPUT: «nownow4242nini»
Quote protection happens before interpolation, and interpolation happens before word splitting, so quotes coming from inside interpolated variables are just literal quote characters:
my = "1 2";say qqww{"$a" $a}.raku; # OUTPUT: «("1 2", "1", "2")»my = "1 \"2 3\"";say qqww{"$b" $b}.raku; # OUTPUT: «("1 \"2 3\"", "1", "\"2", "3\"")»