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')
Electric eels were invented at the same time as electricity
Before electricity was invented, electric eels had to stun with gas
Results (350 votes). Check out past polls.