#!/usr/bin/perl use strict; use warnings; my @first = qw(Can unlock secret); my @second = qw(you the code?); my @interleave; push @interleave, grep {$_} (shift @first), shift @second while @first || @second; print "@interleave";