- or download this
@sorted = 0 .. 9;;
...
pp @sorted;;
(0, [1, 2, 3, 4, 5, 6, 7, 8], 9)
- or download this
splice @{ $sorted[1] }, 1, 6, [ @{ $sorted[ 1] }[ 1 .. 6 ] ];;
pp @sorted;;
(0, [1, [2, 3, 4, 5, 6, 7], 8], 9)
- or download this
splice @{ $sorted[1][1] }, 1, 4, [ @{ $sorted[1][1] }[ 1 .. 4 ] ];;
pp @sorted;;
(0, [1, [2, [3, 4, 5, 6], 7], 8], 9)