in reply to Searching for a string
perlintro contains most of the information you need to do what you want. If you get stuck, read How do I post a question effectively? and feel free to ask any questions about the code you have written here.