diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-26 21:45:41 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-26 21:45:41 +0000 |
commit | 0120eecf48d66b2c5ac028f653ce37c6a866b26b (patch) | |
tree | 4672762c58abfd7b87c1c311161e80225991136b /pod | |
parent | 58231d3970cba2e1fc56f38812334ee802d7acf6 (diff) | |
download | perl-0120eecf48d66b2c5ac028f653ce37c6a866b26b.tar.gz |
revised attribute syntax: C<my $foo :a :b :c>, C<my $foo : a b c>
and C<my $foo : a : b : c> are all valid (from Spider Boardman)
p4raw-id: //depot/perl@4907
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perldelta.pod | 8 | ||||
-rw-r--r-- | pod/perldiag.pod | 2 | ||||
-rw-r--r-- | pod/perlsub.pod | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 495e2ff2e9..f61ee697c1 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -679,9 +679,9 @@ as requiring an automatic lock() when it is entered, you had to declare that with a C<use attrs> pragma in the body of the subroutine. That can now be accomplished with a declaration syntax, like this: - sub mymethod : locked, method ; + sub mymethod : locked method ; ... - sub mymethod : locked, method { + sub mymethod : locked :method { ... } @@ -1914,14 +1914,14 @@ The offending range is now explicitly displayed. =item Invalid separator character %s in attribute list -(F) Something other than a comma or whitespace was seen between the +(F) Something other than a colon or whitespace was seen between the elements of an attribute list. If the previous attribute had a parenthesised parameter list, perhaps that list was terminated too soon. See L<attributes>. =item Invalid separator character %s in subroutine attribute list -(F) Something other than a comma or whitespace was seen between the +(F) Something other than a colon or whitespace was seen between the elements of a subroutine attribute list. If the previous attribute had a parenthesised parameter list, perhaps that list was terminated too soon. diff --git a/pod/perldiag.pod b/pod/perldiag.pod index f3d72605af..b7e115fb71 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1745,7 +1745,7 @@ See L<perlfunc/sprintf>. =item Invalid separator character %s in attribute list -(F) Something other than a comma or whitespace was seen between the +(F) Something other than a colon or whitespace was seen between the elements of an attribute list. If the previous attribute had a parenthesised parameter list, perhaps that list was terminated too soon. See L<attributes>. diff --git a/pod/perlsub.pod b/pod/perlsub.pod index ebb9e55774..927e944c93 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -1230,7 +1230,7 @@ functions to Perl code in L<perlxs>. A subroutine declaration or definition may have a list of attributes associated with it. If such an attribute list is present, it is -broken up at space or comma boundaries and treated as though a +broken up at space or colon boundaries and treated as though a C<use attributes> had been seen. See L<attributes> for details about what attributes are currently supported. Unlike the limitation with the obsolescent C<use attrs>, the @@ -1244,8 +1244,8 @@ nest properly. Examples of valid syntax (even though the attributes are unknown): - sub fnord (&\%) : switch(10,foo(7,3)) , , expensive ; - sub plugh () : Ugly('\(") , Bad ; + sub fnord (&\%) : switch(10,foo(7,3)) : expensive ; + sub plugh () : Ugly('\(") :Bad ; sub xyzzy : _5x5 { ... } Examples of invalid syntax: @@ -1254,7 +1254,7 @@ Examples of invalid syntax: sub snoid : Ugly('(') ; # ()-string not balanced sub xyzzy : 5x5 ; # "5x5" not a valid identifier sub plugh : Y2::north ; # "Y2::north" not a simple identifier - sub snurt : foo + bar ; # "+" not a comma or space + sub snurt : foo + bar ; # "+" not a colon or space The attribute list is passed as a list of constant strings to the code which associates them with the subroutine. In particular, the second example |