my @temp = (); while (@a) { push @temp, shift @a, shift @b } %result = @temp;