in reply to Re: Quicker way to compare these 2 strings?
in thread Quicker way to compare these 2 strings?
Ok, with some minor corrections it works just fine!
Thanks!
Thanks!
$first= "AAAAXXXXAAAAXXXXXXXXXXXAAAA"; $second="AXXXAXXAAXXXXXAAAAXXXXXAAAA"; $matches=0; for $i (0..length($first)-1) { if (substr($first,$i,1) eq substr($second,$i,1)) { $matches++; } } print $matches."\n";
In Section
Seekers of Perl Wisdom