September 2017
Beginner
402 pages
9h 52m
English
The operator xx is the list repetition operator. It is visually and ideologically similar to the x operator, but it works with lists. Consider the following example:
my @data = (10, 20);my @big_data = @data xx 100;say @big_data;
Here, the @data array will be repeated 100 times, and the @big_data variable will contain 100 copies of it.
Be careful not to accidentally mix the xx and x operators. If you use x instead of xx, then the compiler will not warn you, but instead, it will treat the argument as a string and perform string concatenation instead of repeating an array.