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