programming-examples/perl/Array/Reverse a sub-range of an array.pl
2019-11-15 12:59:38 +01:00

4 lines
100 B
Raku

@array = (1, 2, 3, 4, 5, 6);
@array[2 .. 4] = reverse @array[2 .. 4];
print join (", ", @array);