in reply to Longest Common Substring
I second the use of Algorithm::Diff. I wrote a review of it for the monastery, which may be of some use if you're having trouble figuring out how to use it.