Help for this page

Select Code to Download


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