@@ -285,13 +285,15 @@ get this behavior with single quotes.
285
285
286
286
C < qq > allows interpolation of variables. However, by default, only
287
287
scalar variables are interpolated. To get other variables to
288
- interpolate, you need to put square brackets after them. E. g. C << @a =
289
- <1 2 3>;say qq/@a[] example@example.com/; >> results in "1 2 3
290
- example@example.com". Hashes interpolate in a possibly unexpected
291
- manner: C << %a = 1 => 2, 3 => 4;say "%a[]"; >> results in a space
288
+ interpolate, you need to put square brackets after them (the so-called
289
+ L < zen-slice|/language/subscripts#index-entry-Zen_slices > ) to get them to
290
+ interpolate. E.g. C << @a = <1 2 3>; say qq/@a[] example@example.com/; >>
291
+ results in "1 2 3 example@example.com". Hashes interpolate in the same
292
+ manner: C << %a = 1 => 2, 3 => 4;say "%a{}"; >> results in a space
292
293
separating the pairs and tabs separating the key from the value in each
293
- pair (apparently). You can also interpolate Perl 6 code in strings using
294
- curly braces. For all the details, see
294
+ pair (because that's the standard stringification of C < Pair > s, and a hash
295
+ acts as list of C < Pair > s when stringified). You can also interpolate Perl 6
296
+ code in strings using curly braces. For all the details, see
295
297
L < Interpolation|/language/quoting#Interpolation%3A_qq > .
296
298
297
299
C < qw > works as in Perl 5, and can also be rendered as C << <...> >> . E.
0 commit comments