summaryrefslogtreecommitdiff
path: root/pod/perlfunc.pod
diff options
context:
space:
mode:
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r--pod/perlfunc.pod7
1 files changed, 6 insertions, 1 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 4562b2c905..9428a4d67a 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -2929,7 +2929,12 @@ The author of Perl has never felt the need to use this form of C<goto>
does not offer named loops combined with loop control. Perl does, and
this replaces most structured uses of C<goto> in other languages.)
-The C<goto-EXPR> form expects a label name, whose scope will be resolved
+The C<goto-EXPR> form expects to evaluate C<EXPR> to a code reference or
+a label name. If it evaluates to a code reference, it will be handled
+like C<goto-&NAME>, below. This is especially useful for implementing
+tail recursion via C<goto __SUB__>.
+
+If the expression evaluates to a label name, its scope will be resolved
dynamically. This allows for computed C<goto>s per FORTRAN, but isn't
necessarily recommended if you're optimizing for maintainability: