develooper Front page | perl.perl5.porters | Postings from May 2012

Re: [perl #47027] Documentation: BEGIN, END docs in wrong section

Thread Previous | Thread Next
Tom Christiansen
May 4, 2012 09:22
Re: [perl #47027] Documentation: BEGIN, END docs in wrong section
Message ID:
>On Fri May 04 07:13:17 2012, wrote:
>> The section "BEGIN, CHECK, INIT and END" in the
>> "perlmod" docs has nothing to do with modules and should
>> be moved to the "perlsyn" "Compound Statements" section
>> where any reasonable person would expect to find it.

That's not quite true.  

Things like UNITCHECK and END are used as per-module
setup and cleanup code that are called implicitly; hence
the all-caps.  This makes for more robust module design
that making people call mod_setup() and mod_cleanup()
type functions, which they might forget to do.

END works as a classwide destructor, just as DESTROY
works as a per-object destructor.

So I disagree that those functions have nothing to 
do with modules.

And they really *don't* belong in perlsyn.  There is
an argument to be made that they belong in perlsub, but
you cannot say they are unrelated to modules.


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