in reply to Re: Extract common lines from 2 filesin thread Extract common lines from 2 files
I had a very similar question the other day. You can find my complete code on the last post of this thread.
The cpan utility I used is here. (though there is a way to use grep)
Basically you need to open each file and read them into separate arrays. Then cycle through and find the matches.