compare each item of the new array with each key of the hash, incrementing a counter each time there is a match
print the number of matches for the line
close file 2
This may not be the most efficient algorithm, but you can try it, then post your code; you are sure to get constructive criticism on code that you post.