http://www.perlmonks.org?node_id=140577


in reply to Matching bits of 2 strings

If you sort a list of the strings into an array, the deepest matches will be neighbors. That allows you to terminate the search after relatively few applications of japhy's excellent advice.

After Compline,
Zaxo