develooper Front page | perl.perl5.porters | Postings from January 2012

Re: [perl #79824] hash value sharing breakage

Thread Previous | Thread Next
From:
Eric Brine
Date:
January 7, 2012 00:18
Subject:
Re: [perl #79824] hash value sharing breakage
Message ID:
CALJW-qEp+bAKu6+LPko3zRMbr3AR=qfdKNOnhB=NfLd+CFUqiw@mail.gmail.com
On Fri, Nov 26, 2010 at 11:20 AM, Zefram <perlbug-followup@perl.org> wrote:

> # New Ticket Created by  Zefram
> # Please include the string:  [perl #79824]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=79824 >
>
>
> This is a bug report for perl from zefram@fysh.org,
> generated with the help of perlbug 1.36 running under perl 5.10.0.
>
>
> -----------------------------------------------------------------
> [Please enter your report here]
>
> I have a problem where I generate a hash as a munged form of another
> hash and end up with the keys in the munged hash filed under the wrong
> hash value.  The result is that lookups by key don't find the right
> entry in the munged hash.  Minimal demonstration:
>
> $ perl -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 $h{"L\351on"} in print at -e line 1.
>
> $
>

utf8::decode($k) also exhibits the problem (and is far more legitimate than
Encode::_utf8_on).

- Eric

Thread Previous | 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