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')
1. Keep it simple
2. Just remember to pull out 3 in the morning
3. A good puzzle will wake me up
Many. I like to torture myself
0. Socks just get in the way
Results (309 votes). Check out past polls.