develooper Front page | perl.perl5.porters | Postings from December 2003

Re: [DOCPATCH] BEGIN, CHECK, INIT, END explained more

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
December 2, 2003 14:26
Subject:
Re: [DOCPATCH] BEGIN, CHECK, INIT, END explained more
Message ID:
20031202232835.638cf5f1.rgarciasuarez@free.fr
Elizabeth Mattijsen wrote:
> Having been bitten today by the fact that I can't call an INIT block 
> by name (which is not documented as far as I know), I decided to take 
> the bull by the horns and write some corrections and additional text 
> in perlmod.pod and perlsub.pod.
> 
> The most important thing about this patch, is that it introduces (I 
> think) the term "named CODE blocks)" instead of "special subroutines" 
> or "special functions".  I also differentiated BEGIN, CHECK, INIT and 
> END from the "other" all uppercase subroutines, as these are special.

Thanks, applied (with tweaks) as #21832.

I took the liberty to correct some errors, notably on the mechanism
behind O and B : this is not the CHECK block that stops the program, as
you wrote, and it's defined from inside an eval(""), whereas you stated
that CHECK/INIT blocks were ignored in eval("")s. (This eval happens
at compile-time when you load the O module, so it's OK.)

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