develooper Front page | perl.perl5.porters | Postings from July 2016

[perl #128588] Tied hash magic ignored in references the first time'round

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
July 10, 2016 01:19
Subject:
[perl #128588] Tied hash magic ignored in references the first time'round
Message ID:
rt-4.0.18-27872-1468113548-328.128588-15-0@perl.org
On Sat Jul 09 17:50:30 2016, zefram@fysh.org wrote:
> Father Chrysostomos via RT wrote:
> >I have a good counterexample.  If you have dumping code that tries to
> >dump data structures without any side effects (including tied vars),
> >it will no longer be able to use ref $ref_to_var_we_are_dumping without
> >potentially calling code.
> 
> That code is going to have difficulty anyway in dumping data without
> invoking ties.  ref() is far from a unique point of difficulty; how
> do you imagine it acquiring a string value to dump?

You dump the object it is tied to instead.  But I suppose it is easy enough to check tiedness before checking ref.

> The only way to
> walk the data structure without invoking magic is by custom XS code,
> and obviously that's not going to be affected by ref().
> 
> -zefram
> 


-- 

Father Chrysostomos


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

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