http://www.perlmonks.org?node_id=953220


in reply to Joining an array

Here is a splice + join version...
my @t = qw(name John number 7 status unknown); my $i = -1; foreach my $x (1 .. $#t) { splice(@t, $i += 2, 0, $x % 2 ? '=' : '&'); } print join '', @t;