use strict; use warnings; my @first = qw(Can unlock secret); my @second = qw(you the code?); splice(@first, $_+1, 0, $second[$_]) for reverse 0..$#second; print "@first\n";
I notice this is fairly close to one of GrandFather's solutions, but that's really because there is only one best way to do this if the requirement is to use splice.
In reply to Re: splicing two arrays together
by TJPride
in thread splicing two arrays together
by lblake
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |