foreach $c1 (@consonants) { foreach $v1 (@vowels) { foreach $c2 (@consonants) { foreach $v2 (@vowels) { print FH "$c1$v1$c2$v2\n"; } } } }