in reply to splicing two arrays together
use strict; use warnings; my @first = qw(Can unlock secret); my @second = qw(you the code?); my $i = 1; while ( my $word = shift @second ){ splice @first, $i, 0, $word; $i += 2; } print join ' ', @first;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: splicing two arrays together
by morgon (Priest) on Jan 06, 2012 at 00:04 UTC |