in reply to interleaving lists
If you actually want a list as the result, rather than a hash, a for loop would work:my %index; @index{@list1} = @list2;
The push could also be done as a nested loop, if there are lots of arrays to interleave.for (my $i = 0; $i <= $#list1; $i++) { push @result, $list1[$i], $list2[$i]; }
Anyway, that's a very basic solution; much fancier solutions could be written to satisfy more requirements for the interleaving.
|
|---|