From: Gurusamy Sarathy Date: Wed, 1 Dec 1999 05:45:10 +0000 (+0000) Subject: better documentation for goto &NAME (from M. J. T. Guy) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6cb9131c3c45484b20cdd0fbdd8c19fda70c73a8;p=p5sagit%2Fp5-mst-13.2.git better documentation for goto &NAME (from M. J. T. Guy) p4raw-id: //depot/perl@4607 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 3497ca9..16da798 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -1929,13 +1929,20 @@ necessarily recommended if you're optimizing for maintainability: goto ("FOO", "BAR", "GLARCH")[$i]; -The C form is highly magical, and substitutes a call to the -named subroutine for the currently running subroutine. This is used by -C subroutines that wish to load another subroutine and then -pretend that the other subroutine had been called in the first place -(except that any modifications to C<@_> in the current subroutine are -propagated to the other subroutine.) After the C, not even C -will be able to tell that this routine was called first. +The C form is quite different from the other forms of C. +In fact, it isn't a goto in the normal sense at all, and doesn't have +the stigma associated with other gotos. Instead, it +substitutes a call to the named subroutine for the currently running +subroutine. This is used by C subroutines that wish to load +another subroutine and then pretend that the other subroutine had been +called in the first place (except that any modifications to C<@_> +in the current subroutine are propagated to the other subroutine.) +After the C, not even C will be able to tell that this +routine was called first. + +NAME needn't be the name of a subroutine; it can be a scalar variable +containing a code reference, or a block which evaluates to a code +reference. =item grep BLOCK LIST