in reply to (zdog) Re: Trying to make a search Part 2
in thread Trying to make a search Part 2

I would use a hash, like this:
if (/$word/i) { print unless (++$matches{$word} > 1) }
I suppose you could use $_ in place of $word if you wanted.

Update: After seeing swiftone's post I realize that I forgot to adjust case. Thanks swiftone.

if (/$word/i) { print unless (++$matches{lc $word} > 1) }