in reply to interleaving lists

This will handle any number of lists at once without destroying the originals. Pass them in by reference and it will return by reference or value, your choice.
sub interleave { my @lists = map [@$_], @_; my @res; while (my $list = shift @lists) { if (@$list) { push @res, shift @$list; push @lists, $list; } } wantarray ? @res : \@res; }