in reply to Processing words in a file.
I guess you need first word of each line from the file
open FH, '<', "filename.txt" or die "Can not open file $!";
my ($first_word) = $_ =~ /^(\w+)/;
if ($first_word eq 'your string')
Yes, I watch meteor showers
No, I do not watch meteor showers
My meteors prefer to bathe
Results (161 votes). Check out past polls.