What is the best way in which to insert an element between each existing element of an array. The best I have so far is as follows:
my @array = ( 1 , 'foo', { }, [ ] );
my @new_array;
push @new_array, $_, ', ' for @array;
pop @new_array;
In reality, @array contains a mixture of HTML::Element objects and strings that are passed to HTML::Element's splice_content method with the aim of comma separating part of an elements contents.
List::MoreUtils::zipwould help, but you still have to create the array of(', ') x $#arrayto be the alternate items, so it doesn't look like a big saving over this.List::*modules hadn't crossed my mind.