Subject: | utf8 causes undef output |
Date: | Wed, 14 Apr 2010 16:51:59 -0700 |
To: | <bug-Sort-Key [...] rt.cpan.org> |
From: | "MARTIN, JASON (ATTSI)" <JM9991 [...] att.com> |
Module $VERSION = '1.28';
This is perl, v5.8.8 built for sun4-solaris-thread-multi
SunOS xxx 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-V440
The following code causes natsort to emit an undefined value in place of
the expected array of hash keys:
--------
#!/bin/perl -w
Use strict;
use Sort::Key::Natural qw(natsort);
my $foo="abc\xc4\x80def";
utf8::upgrade($foo);
my %VAR = (
$foo => 'bar'
);
foreach my $key ( natsort keys %VAR ) {
print $key . "\n";
}
----------
The output is:
Use of uninitialized value in concatenation (.) or string at /tmp/abc.pl
line 13.