Anonymous Monk,
If you are looking for code and don't know about CPAN, you should check it out. There is Algorithm::LCS and Algorithm::Diff which both implement a ready-made LCS algorithm. If you need to find the LCS of more than 2 strings, I wrote Longest Common Subsequence.