#use strict; #use warnings; open (FILE, 'german.txt'); @words = ; $num = int rand(@words); ($article, $noun) = split(/ /, $words[$num]); chomp($noun); print "Who is the article of $noun:"; chomp($resp = <>); if ($resp eq $article) { print "Correct!"; } else { print "The correct answer is $article!" }