summaryrefslogtreecommitdiff
path: root/pod/perlfunc.pod
diff options
context:
space:
mode:
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r--pod/perlfunc.pod11
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.