summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Golden <dagolden@cpan.org>2011-09-29 21:12:25 -0400
committerDavid Golden <dagolden@cpan.org>2011-09-29 21:12:25 -0400
commit43f66a7639829d7bd7a355e847c3ce0379062a94 (patch)
tree3f7f0a4549b27c707cc7d1e8f0d518887f25adcb
parent4daf2803e944e985fecc670f62f3014dd032a265 (diff)
downloadperl-43f66a7639829d7bd7a355e847c3ce0379062a94.tar.gz
Document BEGIN, END, etc. in perlsyn
This adds a brief note that blocks can be preceded by a compilation phase keyword and points the reader to perlmod for the gory details.
-rw-r--r--pod/perlsyn.pod5
1 files changed, 5 insertions, 0 deletions
diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod
index 702ebed929..93c640c18d 100644
--- a/pod/perlsyn.pod
+++ b/pod/perlsyn.pod
@@ -239,6 +239,7 @@ The following compound statements may be used to control flow:
LABEL foreach VAR (LIST) BLOCK
LABEL foreach VAR (LIST) BLOCK continue BLOCK
LABEL BLOCK continue BLOCK
+ PHASE BLOCK
Note that, unlike C and Pascal, these are defined in terms of BLOCKs,
not statements. This means that the curly brackets are I<required>--no
@@ -279,6 +280,10 @@ conditional is about to be evaluated again. Thus it can be used to
increment a loop variable, even when the loop has been continued via
the C<next> statement.
+When a block is preceding by a compilation phase keyword such as C<BEGIN>,
+C<END>, C<INIT>, C<CHECK>, or C<UNITCHECK>, then the block will run only
+during the corresponding phase of execution. See L<perlmod> for more details.
+
Extension modules can also hook into the Perl parser to define new
kinds of compound statement. These are introduced by a keyword which
the extension recognizes, and the syntax following the keyword is