develooper Front page | perl.perl5.porters | Postings from September 2017

[perl #105918] Tied hashes stringify their hash keys as of 5.8.3

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
September 30, 2017 02:39
Subject:
[perl #105918] Tied hashes stringify their hash keys as of 5.8.3
Message ID:
rt-4.0.24-18591-1506739171-1718.105918-15-0@perl.org
On Sun, 11 Dec 2011 21:15:10 GMT, sprout wrote:
> As of this commit:
> 
> commit 113738bb099c38d994cf82554560490df0f6d525
> Author: Nicholas Clark <nick@ccl4.org>
> Date:   Wed Nov 19 22:28:25 2003 +0000
> 
> merge hv_fetch and hv_fetch_ent into hv_fetch_common
> remove S_hv_fetch_flags
> hv.c now 13% smaller than when I started. hv_store TODO
> 
> p4raw-id: //depot/perl@21753
> 
> tied hashes now stringify their keys:
> 
> {
>   package o;
>   use overload '""' => sub { warn "stingify"; "a" };
> }
> 
> sub TIEHASH { bless [] }
> sub STORE { warn join " ", map +(ref||$_), @'_ }
> 
> tie %h, "";
> 
> $h{bless [], o} = 34;
> __END__
> 
> That should not print ‘stingify’.
> 
> The value passed to STORE is not stringified, but the keys get
> stringified unnecessarily on the way.
> 
> This caused a script to blow up in my face, because the object in
> question couldn’t stringify without creating another object that was
> stored in the same cache.
> 

This ticket was filed nearly 6 years ago.  It concerns a commit made nearly 14 years ago.  But in the time the ticket has been open there have been no other comments.

Can we infer that this is not a problem that needs fixing?

Thank you very much.

-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=105918

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