open my $fh, "text_file_with_words.txt" or die; while (my $line = <$fh>) { ... }