summaryrefslogtreecommitdiff
path: root/pod/perlmod.pod
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-06-28 16:01:08 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-06-28 16:01:08 +0000
commitca62f0fc957407f48588d44995309a50a80e45ab (patch)
tree0acf6906f0079b002f595073970710e59e55a4f0 /pod/perlmod.pod
parent23f3589e21445e9141901c2894bc97b457493332 (diff)
downloadperl-ca62f0fc957407f48588d44995309a50a80e45ab.tar.gz
Some clarification about the current semantics of CHECK and
INIT blocks. See bug [perl #22826]. p4raw-id: //depot/perl@19872
Diffstat (limited to 'pod/perlmod.pod')
-rw-r--r--pod/perlmod.pod20
1 files changed, 11 insertions, 9 deletions
diff --git a/pod/perlmod.pod b/pod/perlmod.pod
index 6cbdce3f9b..c03862d64d 100644
--- a/pod/perlmod.pod
+++ b/pod/perlmod.pod
@@ -283,15 +283,17 @@ going to pass to C<exit()>. You can modify C<$?> to change the exit
value of the program. Beware of changing C<$?> by accident (e.g. by
running something via C<system>).
-Similar to C<BEGIN> blocks, C<INIT> blocks are run just before the
-Perl runtime begins execution, in "first in, first out" (FIFO) order.
-For example, the code generators documented in L<perlcc> make use of
-C<INIT> blocks to initialize and resolve pointers to XSUBs.
-
-Similar to C<END> blocks, C<CHECK> blocks are run just after the
-Perl compile phase ends and before the run time begins, in
-LIFO order. C<CHECK> blocks are again useful in the Perl compiler
-suite to save the compiled state of the program.
+C<CHECK> and C<INIT> blocks are useful to catch the transition between
+the compilation phase and the execution phase of the main program.
+
+C<CHECK> blocks are run just after the Perl compile phase ends and before
+the run time begins, in LIFO order. C<CHECK> blocks are used in
+the Perl compiler suite to save the compiled state of the program.
+
+C<INIT> blocks are run just before the Perl runtime begins execution, in
+"first in, first out" (FIFO) order. For example, the code generators
+documented in L<perlcc> make use of C<INIT> blocks to initialize and
+resolve pointers to XSUBs.
When you use the B<-n> and B<-p> switches to Perl, C<BEGIN> and
C<END> work just as they do in B<awk>, as a degenerate case.