http://www.perlmonks.org?node_id=881562


in reply to Help with script to search all files for certain words.

Perhaps a combination of File::Grep and Regexp::Assemble will do the trick? If File::Grep isn't to your liking I suggest File::Find::Rule.