use String::Approx qw(amatch adist); my $str1 = "dn despaigne"; my $str2 = "dan despaigne"; print "matched\n" if amatch($str1, $str2); print "matched\n" if amatch($str1, ["5%"], $str2); printf "distance = %d\n", adist($str1, $str2); # number of edits required