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')
An electronic device
Being the designated driver
Spending time with a celebrity
I never won anything
I never play the lottery
I haven't checked my spam folder recently
Results (343 votes). Check out past polls.