develooper Front page | perl.perl5.porters | Postings from March 2000

Re: [PATCH 5.6.0] perlmod.pod

Thread Previous
Tom Christiansen
March 23, 2000 13:26
Re: [PATCH 5.6.0] perlmod.pod
Message ID:
>Quoth perlmod:

>        ... END blocks are not executed when you run perl with the -c
>        switch.
>	...
>        When you use the -n and -p switches to Perl, BEGIN and END
>        work just as they do in awk, as a degenerate case.  As
>        currently implemented (and subject to change, since its
>        inconvenient at best), both BEGIN and<END> blocks are run
>        when you use the -c switch for a compile-only syntax
>        check, although your main code is not.

>This latter point appears to be incorrect wrt END blocks:

perlrun states:

    B<-c> causes Perl to check the syntax of the program and then
    exit without executing it.  Actually, it I<will> execute C<BEGIN>,
    C<CHECK>, and C<use> blocks, because these are considered as
    occurring outside the execution of your program.  C<INIT> and
    C<END> blocks, however, will be skipped.


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