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

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

Thread Previous | Thread Next
From:
demerphq
Date:
June 15, 2017 01:03
Subject:
Re: lib/_charnames.pm puts references in %^H
Message ID:
CANgJU+WWv39eUdM9wxEJuPNT0kMfcYMkVCi6VwwohEKEZx3bQA@mail.gmail.com
On 15 June 2017 at 03:00, Zefram <zefram@fysh.org> wrote:
> demerphq wrote:
>>              Would it be fair to say that it is as though the sub
>>being called by "\N{TEST}" was wrapped in a BEGIN?
>
> Kinda.  \N{} and BEGIN are two ways of running code at compile time.
> There are others, such as "use" (which calls an import method at compile
> time).  No one of these mechanisms is more fundamental than the rest.

Sure, but use is formally defined in terms of BEGIN in the docs,
wheras it is not so clear that \N{...} is.

Anyway, thanks for the explanation. I have used %^H before, but I
either never noticed some of the subtleties, or forgot about them long
ago...

cheers,
Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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