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;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Joining an array
by trizen (Hermit) on Feb 12, 2012 at 01:56 UTC |
In Section
Seekers of Perl Wisdom