use strict; use warnings; my @first = qw(Can unlock secret); my @second = qw(you the code?); my $result = join " ", map { ($first[$_], $second[$_]) } (0..$#first); print $result;