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
Father Chrysostomos via RT
July 10, 2016 01:19
[perl #128588] Tied hash magic ignored in references the first time'round
Message ID:
On Sat Jul 09 17:50:30 2016, 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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About