# print elements up to the shortest array length while( @array1 && @array2) { my $v1= shift @array1; my $v2= shift @array2; print $v1, $v2; }