in reply to Search for a string in a file

  1. perldoc -f open
  2. perldoc perlretut
  3. use strict; use warnings

When you've read these, you'll pretty much have your answer.

But before you post a followup question, if any, On asking for help, How do I post a question effectively?, Markup in the Monastery and Super Search.