in reply to Re^4: Using Splice with Two Arrays within a loop
in thread Using Splice with Two Arrays within a loop
Now with death build in.
sub interleave_words { my @results = splice @_, shift; die "Arrays of different size\n" unless @results == @_; splice @results, 2*$_, 0, shift for 0..@results-1; return @results; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Using Splice with Two Arrays within a loop
by gponcho (Initiate) on Jun 10, 2013 at 21:04 UTC | |
by AnomalousMonk (Archbishop) on Jun 10, 2013 at 22:25 UTC | |
by hdb (Monsignor) on Jun 11, 2013 at 07:22 UTC | |
by gponcho (Initiate) on Jun 11, 2013 at 12:18 UTC | |
by hdb (Monsignor) on Jun 10, 2013 at 21:09 UTC |