@consonants = ('p','t','k','b','d','g','f','s','z','m','n','l','r'); @vowels = ('a','e','i','o','u'); # Let's also keep track of how many words we have generated $number_of_words = 0; # Loop through consonants for ($c = 0; $c <= $#consonants; $c++) { # Loop through vowels for ($v = 0; $v <= $#vowels; $v++) { # Print out this CV combination print "$consonants[$c]$vowels[$v]\n"; # Add one to the number of words $number_of_words++; } } print "\nGenerated a total of $number_of_words words\n";