@array1 = qw(host1 host2 host3); @array2 = qw(ip1 ip2 ip3); # I want the output to look like below ip1 host1 ip2 host2 ip3 host3