Broloc,
Coderifous' routine will work for you if you wrap it into a sub.
sub MatchCount($$){
my ($word, $word_2) =@_;
my $x, $matchCount;
for($x=0;$x <= length($word); $x++){
$matchCount++
if(substr($word,$x,1) eq substr($word_2,$x,1));
}
return $matchCount;
}
Then, in your script, you can say:
if (MatchCount('charmed','cracked') >= 4){
print "Matched\n";
} Mike
Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884
It's like this; even samurai have teddy bears, and even teddy bears get drunk.