http://qs321.pair.com?node_id=308375


in reply to Re: appending arrays
in thread appending arrays

Here's a similar way, without initializing either counter:

push @new, $array1[$count1++].$array2[--$count2] while ($count1 < @array1 && -$count2 < @array2);
By the way, your array accesses are using 1 element slices instead of direct element access. Consider changing @array1[$a1count] to $array1[$a1count].

kelan


Perl6 Grammar Student