Subject: | utf8 problems |
The routine works correctly with utf8, but prints out nonsense to STDERR
when processing:
ben ~ 634 $ ./lev.pl
substr outside of string at
/usr/local/lib/perl5/site_perl/5.10.0/Text/Levenshtein.pm line 49.
Use of uninitialized value in string eq at
/usr/local/lib/perl5/site_perl/5.10.0/Text/Levenshtein.pm line 49.
2
See attached file (utf8 format) for test case. Replacing with ASCII
returns it to normal behaviour.
Subject: | lev.pl |
#!/usr/local/bin/perl -w
use strict;
use Text::Levenshtein 'distance';
use utf8;
my $haystack = 'ããããã';
my $needle = 'ããã';
$haystack = 'boboi';
$needle = 'babi';
print distance ($needle, $haystack),"\n";