# Remove the 4th column. splice(@$_, 3, 1) foreach @$rows; #### # Swap the 3rd and 4th columns. splice(@$_, 2, 0, splice(@$_, 3, 1)) foreach @$rows; #### # Swap the 3rd and 4th columns. my @map = (0, 1, 3, 2, 4, 5); @$_ = @$_[@map] foreach @$rows;