To interpolate array elements in double-quoted strings write it as you do in a program itself:
@data. To interpolate the whole array, add a pair of empty brackets:
@data. The following program illustrates this approach:
my @data = 10, 20, 30; say "First: @data, last: @data"; say "All elements: @data";
This program prints the requested data:
$ raku t.raku First: 10, last: 20 All elements: 10 20 30
Complete the quiz that covers the contents of this topic.
💪 Or jump directly to the exercises to this section.