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;