Repeat operator "x"
Using the repeat operator "x" , string or You can concatenate arrays as many times as you want.
# Repeated string concatenation my $str2 = $str1 x 3; # Concatenate arrays repeatedly my @array2 = @array1 x 3;
This is an example program that repeatedly concatenates strings.
my $str = 'abc' x 3;
$str becomes "abcabcabc".
This is an example that repeatedly concatenates arrays.
my @nums = (1, 2, 3) x 3;
@nums becomes (1, 2, 3, 1, 2, 3, 1, 2, 3).