@array1 = (1, 2, 3, 1, 2, 3, 1, 2, 3 ); @array2 = (blue, white, yellow, blue, white, yellow, blue, white, yellow); while (@array1) { (@p1) = (shift(@array1), shift(@array1), shift(@array1)); (@p2) = (shift(@array2), shift(@array2), shift(@array2)); printf("%s %s %s %s %s %s\n", (@p1), (@p2)); }