in reply to Is it possible to find the number of matching and non-matching positions in strings using perl code?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is it possible to find the number of matching and non-matching positions in strings using perl code?
by sauoq (Abbot) on May 11, 2012 at 01:16 UTC |