I need to search for a specific piece of text in all files in a directory. Since I also need to do this recursively I want to use File::Find.
I can return file names easily. What I need to do, though, is to search for the pattern then only print out those files which have the pattern in it. I don't want to do anything to the files; I just want a list returned.
I know it's simple but for some reason I have thrown up a brick wall.
I'm assuming (I know that can be dangerous) that I would need to do an open(FH, $file) on each file returned then search for the pattern then.
Am I even on the right track?
Thanks.
In reply to text search in a file by goosefairy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |