Change 17208 by jhi@jhibook on 2002/06/12 22:36:15

        Document the my/our TYPE and ATTRIBUTES (Use the Camel Mk 3, Luke).

Affected files ...

.... //depot/perl/lib/attributes.pm#11 edit
.... //depot/perl/pod/perlfunc.pod#336 edit

Differences ...

==== //depot/perl/lib/attributes.pm#11 (text) ====
Index: perl/lib/attributes.pm
--- perl/lib/attributes.pm#10~16822~    Mon May 27 13:42:47 2002
+++ perl/lib/attributes.pm      Wed Jun 12 15:36:15 2002
@@ -191,10 +191,7 @@
 
 =back
 
-There are no built-in attributes for anything other than subroutines.
-
-=for hackers
-What about C<unique>?
+For global variables there is C<unique> attribute: see L<perlfunc/our>.
 
 =head2 Available Subroutines
 

==== //depot/perl/pod/perlfunc.pod#336 (text) ====
Index: perl/pod/perlfunc.pod
--- perl/pod/perlfunc.pod#335~17202~    Wed Jun 12 05:33:33 2002
+++ perl/pod/perlfunc.pod       Wed Jun 12 15:36:15 2002
@@ -2626,12 +2626,22 @@
 
 =item my EXPR
 
+=item my TYPE EXPR
+
 =item my EXPR : ATTRIBUTES
 
+=item my TYPE EXPR : ATTRIBUTES
+
 A C<my> declares the listed variables to be local (lexically) to the
 enclosing block, file, or C<eval>.  If
-more than one value is listed, the list must be placed in parentheses.  See
-L<perlsub/"Private Variables via my()"> for details.
+more than one value is listed, the list must be placed in parentheses.
+
+The use of TYPE and ATTRIBUTES is considered experimental and subject
+to change.  TYPE is currently bound to the use of C<fields> pragma,
+and attributes are handled using the C<attributes> pragma, or starting
+from Perl 5.8.0 also via the C<Attribute::Handlers> module.  See
+L<perlsub/"Private Variables via my()"> for details, and L<fields>,
+L<attributes>, and L<Attribute::Handlers>.
 
 =item next LABEL
 
@@ -3058,8 +3068,12 @@
 
 =item our EXPR
 
+=item our EXPR TYPE
+
 =item our EXPR : ATTRIBUTES
 
+=item our TYPE EXPR : ATTRIBUTES
+
 An C<our> declares the listed variables to be valid globals within
 the enclosing block, file, or C<eval>.  That is, it has the same
 scoping rules as a "my" declaration, but does not create a local
@@ -3099,15 +3113,20 @@
     our $bar;          # emits warning
 
 An C<our> declaration may also have a list of attributes associated
-with it.  B<WARNING>: This is an experimental feature that may be
-changed or removed in future releases of Perl.  It should not be
-relied upon.
-
-The only currently recognized attribute is C<unique> which indicates
-that a single copy of the global is to be used by all interpreters
-should the program happen to be running in a multi-interpreter
-environment. (The default behaviour would be for each interpreter
-to have its own copy of the global.)  Examples:
+with it.
+
+The use of TYPE and ATTRIBUTES is considered experimental and subject
+to change.  TYPE is currently bound to the use of C<fields> pragma,
+and attributes are handled using the C<attributes> pragma, or starting
+from Perl 5.8.0 also via the C<Attribute::Handlers> module.  See
+L<perlsub/"Private Variables via my()"> for details, and L<fields>,
+L<attributes>, and L<Attribute::Handlers>.
+
+The only currently recognized C<our()> attribute is C<unique> which
+indicates that a single copy of the global is to be used by all
+interpreters should the program happen to be running in a
+multi-interpreter environment. (The default behaviour would be for
+each interpreter to have its own copy of the global.)  Examples:
 
     our @EXPORT : unique = qw(foo);
     our %EXPORT_TAGS : unique = (bar => [qw(aa bb cc)]);
End of Patch.

Reply via email to