From 43f66a7639829d7bd7a355e847c3ce0379062a94 Mon Sep 17 00:00:00 2001 From: David Golden Date: Thu, 29 Sep 2011 21:12:25 -0400 Subject: [PATCH] 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. --- pod/perlsyn.pod | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index 702ebed..93c640c 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--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 statement. +When a block is preceding by a compilation phase keyword such as C, +C, C, C, or C, then the block will run only +during the corresponding phase of execution. See L 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 -- 2.7.4