@array = (2, 25, 2, 26, 2, 27, 2, 28, 2, 29); for ($i = 0; $i < @array; $i++) { print "Slot: $array[$i*2], port: $array[$i*2 + 1]\n" }