in reply to Text::Levenshtein - trouble

There are some bug reports for Text::Levenshtein, and at least one sounds somewhat similar and even has a patch.

Replies are listed 'Best First'.
Re^2: Text::Levenshtein - trouble
by Anonymous Monk on Jul 11, 2012 at 15:48 UTC

    Indeed, the module is buggy. The comment here helped unbreak a script I wrote using the module. The lines that need to be commented are:

    # in distance() foreach my $i (1 .. $n) { #if ($i != $n && substr($s,$i) eq substr($t,$i)) { # push @result,$i;next; #} $d[$i][0]=$i; } foreach my $j (1 .. $m) { #if ($j != $m && substr($s,$j) eq substr($t,$j)) { # push @result,$j;next; #} $d[0][$j]=$j; } # and the two early returns in fastdistance()