for (0..5) { # set $key and $val for this iteration, and: push @array, [ $key, $val ]; } # equivalent to: $array[0][0] => $array[0][1]