diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-02 01:43:25 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-02 01:43:25 +0000 |
commit | 6c1372ede9e641f6d25ae7a5966416ab272c51d3 (patch) | |
tree | 643dc03cbfff8546cb9b4966afb62e1a96dc6609 /pod/perlfunc.pod | |
parent | b5677e74535f1db572e121385ce38c412bd75d2e (diff) | |
download | perl-6c1372ede9e641f6d25ae7a5966416ab272c51d3.tar.gz |
add notes about effect of loop control statements inside
LABEL BLOCK continue BLOCK
p4raw-id: //depot/perl@4277
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r-- | pod/perlfunc.pod | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 82c052148b..a09c6e5d46 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2149,6 +2149,10 @@ C<last> cannot be used to exit a block which returns a value such as C<eval {}>, C<sub {}> or C<do {}>, and should not be used to exit a grep() or map() operation. +Note that a block by itself is semantically identical to a loop +that executes once. Thus C<last> can be used to effect an early +exit out of such a block. + See also L</continue> for an illustration of how C<last>, C<next>, and C<redo> work. @@ -2394,6 +2398,9 @@ C<next> cannot be used to exit a block which returns a value such as C<eval {}>, C<sub {}> or C<do {}>, and should not be used to exit a grep() or map() operation. +Note that a block by itself is semantically identical to a loop +that executes once. Thus C<next> will exit such a block early. + See also L</continue> for an illustration of how C<last>, C<next>, and C<redo> work. @@ -3285,6 +3292,10 @@ C<redo> cannot be used to retry a block which returns a value such as C<eval {}>, C<sub {}> or C<do {}>, and should not be used to exit a grep() or map() operation. +Note that a block by itself is semantically identical to a loop +that executes once. Thus C<redo> inside such a block will effectively +turn it into a looping construct. + See also L</continue> for an illustration of how C<last>, C<next>, and C<redo> work. |