in reply to Compare two strings of same length, character-by-character

If all you want in the end is a percentage, you may want to look up established string similarity algorithms. See for example the perl module String::Similarity.

If you are willing to look outside perl, see e.g. https://github.com/adrg/strutil and references therein.

  • Comment on Re: Compare two strings of same length, character-by-character