develooper Front page | perl.perl5.porters | Postings from August 2013

Re: [perl #79824] hash value sharing breakage

Thread Next
From:
Zefram
Date:
August 28, 2013 14:57
Subject:
Re: [perl #79824] hash value sharing breakage
Message ID:
20130828145642.GA3986@fysh.org
Father Chrysostomos via RT wrote:
>According to our records, your request regarding 
>  "hash value sharing breakage" 
>has been resolved. 

My original pure-Perl test case still exhibits the problem that I
reported, in perl 5.18.1 and 5.19.3.

$ perl5.18.1 -MEncode -lwe '%a=("L\x{c3}\x{a9}on"=>"acme"); ($k)=(keys %a); Encode::_utf8_on($k); %h = ($k => "acme"); print $h{"L\x{e9}on"}'
Use of uninitialized value in print at -e line 1.

Either this case should start working, perhaps by Encode::_utf8_on()
performing some COW operation, or the documentation for Encode::_utf8_on()
needs more caveats.  (Currently it has a big warning about UTF-8
well-formedness, but this usage does not fall foul of that.)

Using utf8::decode() instead of Encode::_utf8_on() does not exhibit the
problem in perl 5.14 and above.  (In perl 5.12 it did.)

-zefram

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About