in reply to Re^2: how to search for a string in a particular file?
in thread how to search for a string in a particular file?

I guess instead of using $_, you can use something like

my @lines = <FILE>; while (<FILE>) { if ($_ =~ /nine/) { print "found\n"; } else { print "not found\n"; } }
i haven't tried it, but i think this is how it's done