Just personal preference here but instead of using grep, regexes etc check out PPI "PPI - Parse, Analyze and Manipulate Perl (without perl)". I have used it before to get an inventory of some code that I wasn't familiar with and it works well. Plus if you decide later you want to find more information like variables and what not it's pretty easy to filter out new items.