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

Re: lib/_charnames.pm puts references in %^H

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
June 15, 2017 10:29
Subject:
Re: lib/_charnames.pm puts references in %^H
Message ID:
20170615112858.14b300ee@shy.leonerd.org.uk
On Thu, 15 Jun 2017 03:01:28 +0200
demerphq <demerphq@gmail.com> wrote:

> During compilation this hash may be used to store complex
> structures, such as code references, however once compilation is
> completed these structures will be flattened to a representation
> that means that only simple values can be accommodated and retrieved
> at run time via C<caller()> as above.

I'd say that doesn't quite fit with Zefram's clarification. I'd write
something more like:

  During compilation this hash may be used to store complex structures,
  such as code references, as well as simple non-referential scalars. A
  flattened copy of the values written into the hash is stored with the
  code that was compiled while it was in effect, and is the copy
  available via the C<caller()> mechanism. This copy preserves simple
  strings and numbers, but will not preserve more complex values like
  references.

Just to really hammer home the point that was clarified; in that
there's two copies storing two versions of the truth, and whether or
not references work depends on which copy you are reading from.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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