in reply to Match a string only once in a file

Slurp the file into a scalar and then do a single match on it per value you're looking for. Like so:
local $/; my $file = <IN>; close IN; @array=('file', 'this', 'dog', 'forward'); foreach $searchstring(@array) { if ($file=~m/$searchstring/i) { push @stringsfound,$searchstring; } }
The foreach block can also be written as
@stringsfound=grep {$file=~/$_/i} @array;
I changed your regular expression, omitting the (.*)? since it didn't seem to be fulfilling any useful function (ordinarily this would capture any characters before $searchstring into $1, but you're not using $1 for anything).