push(@temp, a , b); I also tried with getting the values into two 1 dimensional arrays and putting them in one using @temp = (\@arraya, \@arrayb); does not seem to be working. both the arrays are same size. I want values in the following way... a b c d