in reply to interleaving lists

I might do it:
@combined = map { $list1[$_], $list2[$_] } 0 .. ($#list1 > $#list2 ? $#list1 : $#list2);
This inserts 'undef's in the event one array is longer than the other.

Replies are listed 'Best First'.
oooh
by Anonymous Monk on Jan 23, 2001 at 22:31 UTC
    Ahhh, elegant. Thanks, this is exactly what I was looking for.
      Of course if you're filling a hash, it's already been mentioned that this is probably the best solution:
      my %hash; @hash{@keys} = @values;
Re: Re: interleaving lists
by rmgiroux (Initiate) on Jan 23, 2001 at 18:32 UTC
    Nice!