in reply to Grepping a File

You're using grep correctly. Your expectations of what it should return are incorrect. When I find my code returning unexpected results, I check perldoc. That would have helped you.

Secondly, I suggest that if you're going to search through the contents of a file, read the lines of the file into an array or use a while loop. I find that I'm iterating over lines of a file much much more than I slurp the contents into a variable.

--
jpg