summaryrefslogtreecommitdiff
path: root/pod/perlsub.pod
diff options
context:
space:
mode:
authorPeter Martini <PeterCMartini@GMail.com>2015-01-18 11:09:55 -0500
committerPeter Martini <PeterCMartini@GMail.com>2015-01-18 11:09:55 -0500
commit71917f62ec6a27775a4203ed323eb090855a4ecf (patch)
treed09d65da875b06100434d1e421b2fcc1e0e53d8b /pod/perlsub.pod
parentabcf453dd6979dbea87c2837edef79d52f31684d (diff)
downloadperl-71917f62ec6a27775a4203ed323eb090855a4ecf.tar.gz
Update perlsub to reflect attribute/signature relo
As initially introduced in 5.20, sub signatures came after attributes. For 5.22, they will come before attributes, like prototypes did. This commit updates the docs to that effect.
Diffstat (limited to 'pod/perlsub.pod')
-rw-r--r--pod/perlsub.pod7
1 files changed, 3 insertions, 4 deletions
diff --git a/pod/perlsub.pod b/pod/perlsub.pod
index 75d92aa2e4..a6d000de1e 100644
--- a/pod/perlsub.pod
+++ b/pod/perlsub.pod
@@ -489,13 +489,12 @@ a signature. They do different jobs: the prototype affects compilation
of calls to the subroutine, and the signature puts argument values into
lexical variables at runtime. You can therefore write
- sub foo :prototype($$) ($left, $right) {
+ sub foo ($left, $right) : prototype($$) {
return $left + $right;
}
-The prototype attribute, and any other attributes, must come before
-the signature. The signature always immediately precedes the block of
-the subroutine's body.
+The prototype attribute, and any other attributes, come after
+the signature.
=head2 Private Variables via my()
X<my> X<variable, lexical> X<lexical> X<lexical variable> X<scope, lexical>