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

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

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
May 4, 2012 09:22
Subject:
Re: [perl #47027] Documentation: BEGIN, END docs in wrong section
Message ID:
22295.1336148567@chthon
>On Fri May 04 07:13:17 2012, denis.howe@gmail.com 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.

--tom

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