Remove its outdated documentation.
p4raw-id: //depot/perl@27498
#define CVf_CLONED 0x0040 /* a clone of one of those */
#define CVf_ANON 0x0080 /* CvGV() can't be trusted */
#define CVf_UNIQUE 0x0100 /* sub is only called once (eg PL_main_cv,
- * require, eval). Not to be confused
- * with the GVf_UNIQUE flag associated
- * with the :unique attribute */
+ * require, eval). */
#define CVf_NODEBUG 0x0200 /* no DB::sub indirection for this CV
(esp. useful for special XSUBs) */
#define CVf_CONST 0x0400 /* inlinable sub */
=item The 'unique' attribute may only be applied to 'our' variables
-(F) Currently this attribute is not supported on C<my> or C<sub>
-declarations. See L<perlfunc/our>.
+(F) This attribute was never supported on C<my> or C<sub> declarations.
=item This Perl can't reset CRTL environ elements (%s)
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)]);
- our $VERSION : unique = "1.00";
-
-Note that this attribute also has the effect of making the global
-readonly when the first new interpreter is cloned (for example,
-when the first new thread is created).
-
-Multi-interpreter environments can come to being either through the
-fork() emulation on Windows platforms, or by embedding perl in a
-multi-threaded application. The C<unique> attribute does nothing in
-all other environments.
-
-Warning: the current implementation of this attribute operates on the
-typeglob associated with the variable; this means that C<our $x : unique>
-also has the effect of C<our @x : unique; our %x : unique>. This may be
-subject to change.
-
=item pack TEMPLATE,LIST
X<pack>
!=~ should be !~ at - line 8.
!=~ should be !~ at - line 9.
!=~ should be !~ at - line 10.
+########
+# toke.c
+our $foo :unique;
+use warnings 'deprecated';
+our $bar :unique;
+EXPECT
+Use of :unique is deprecated at - line 4.
}
else {
if (len == 6 && strnEQ(s, "unique", len)) {
- if (PL_in_my == KEY_our)
+ if (PL_in_my == KEY_our) {
#ifdef USE_ITHREADS
GvUNIQUE_on(cGVOPx_gv(yylval.opval));
#else
- /*EMPTY*/; /* skip to avoid loading attributes.pm */
+ /* skip to avoid loading attributes.pm */
+ deprecate(":unique");
#endif
+ }
else
Perl_croak(aTHX_ "The 'unique' attribute may only be applied to 'our' variables");
}