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

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

Thread Previous | Thread Next
Elizabeth Mattijsen
November 30, 2003 02:40
Re: [DOCPATCH] BEGIN, CHECK, INIT, END explained more
Message ID:
At 17:41 -0500 11/29/03, Ronald J Kimball wrote:
>On Sat, Nov 29, 2003 at 11:15:56PM +0100, Elizabeth Mattijsen wrote:
>>  --- pod/perlmod.pod.original	Sat Nov 29 21:39:52 2003
>>  +++ pod/perlmod.pod	Sat Nov 29 23:00:46 2003
>>  +A C<BEGIN> CODE block is executed as soon as possible, that is, the moment
>>  +it is completely defined, even before the rest of the containing file (or
>>  +string) is parsed.  You may have multiple C<BEGIN> blocks within a file (or
>  > +string) -- they will execute in order of definition.  Because a C<BEGIN>
>I think 'string' here should be 'eval string' (or 'evaled string').
>Otherwise someone may think BEGIN {} blocks are executed in any string.

Ok...I agree...  I just wanted to add the fact that BEGIN blocks in 
eval "" are also honoured: they don't need to reside in a file per se.

>  > --- pod/perlsub.pod.original	Sat Nov 29 22:12:17 2003
>>  +++ pod/perlsub.pod	Sat Nov 29 22:50:01 2003
>>  @@ -202,13 +202,17 @@
>>  +The C<BEGIN>, C<CHECK>, C<INIT> and C<END> subroutines are not so much
>  > +subroutines as well as named magic CODE blocks, of which you can have more
>I think 'as well as' should just be 'as'.

I guess I should put my verbose mode to "off"   ;-)   Agreed.

Are those the only comments?   "named magic CODE blocks" are a good 
description for BEGIN, CHECK, INIT and END?


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