my @num = qw (1 2 3 4 5); my @alp = qw (A B C D E); # these two arrays always come in same size foreach my $num (@num){ foreach my $alp(@alp){ print "$num-$alp\n"; } }