Subject: | numerous 'substr outside of string' warnings from Text::Levenshtein::distance |
e.g.:
$ perl5.8.5 -MText::Levenshtein -w -e 'print Text::Levenshtein::distance("fish", "octopus"), "\n";'
substr outside of string at /usr/lib/perl5/site_perl/5.8.5/Text/Levenshtein.pm line 49.
Use of uninitialized value in string eq at /usr/lib/perl5/site_perl/5.8.5/Text/Levenshtein.pm line 49.
substr outside of string at /usr/lib/perl5/site_perl/5.8.5/Text/Levenshtein.pm line 49.
Use of uninitialized value in string eq at /usr/lib/perl5/site_perl/5.8.5/Text/Levenshtein.pm line 49.
7
This only occurs for distances between strings of different lengths. What's going on is that the loop at line 49 is tring to consider prefixes of the string which are too long, but I haven't looked at whether fixing it not to is as simple as changing the limit on the for loop.
Text::LevenshteinXS seems not to have this problem.