I would split the strings into character arrays and then count the matches returned by the each_array function of the module List::MoreUtils. Nomatches is the length of the string minus number of matches.
If efficiency is an issue, the substr method already posted is probably better. Profile to be sure.
In reply to Re: Is it possible to find the number of matching and non-matching positions in strings using perl code?
by BillKSmith
in thread Is it possible to find the number of matching and non-matching positions in strings using perl code?
by supriyoch_2008
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |