$z[$_] .= $d[$_] for 0..$#z; # one way @z = map($z[$_].$d[$_], 0..$#z); # another way