# 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()