goto &Carp::carp;
}
+my %deprecated;
+$deprecated{CODE} = qr/\A-?(locked)\z/;
+$deprecated{ARRAY} = $deprecated{HASH} = $deprecated{SCALAR}
+ = qr/\A-?(unique)\z/;
+
sub _modify_attrs_and_deprecate {
my $svtype = shift;
# Now that we've removed handling of locked from the XS code, we need to
# XS, we can't control the warning based on *our* caller's lexical settings,
# and the warned line is in this package)
grep {
- $svtype eq 'CODE' && /\A-?locked\z/ ? do {
+ $deprecated{$svtype} && /$deprecated{$svtype}/ ? do {
require warnings;
- warnings::warnif('deprecated', 'Attribute "locked" is deprecated');
+ warnings::warnif('deprecated', "Attribute \"$1\" is deprecated");
0;
} : 1
} _modify_attrs(@_);
}
break;
default:
- switch ((int)len) {
- case 6:
- switch (name[5]) {
- case 'd':
- if (memEQ(name, "share", 5)) {
+ if (memEQs(name, 6, "shared")) {
if (negated)
Perl_croak(aTHX_ "A variable may not be unshared");
SvSHARE(sv);
continue;
- }
- break;
- case 'e':
- if (memEQ(name, "uniqu", 5)) {
- if (isGV_with_GP(sv)) {
- if (negated) {
- GvUNIQUE_off(sv);
- } else {
- GvUNIQUE_on(sv);
- }
- }
- /* Hope this came from toke.c if not a GV. */
- continue;
- }
- }
- }
+ }
break;
}
/* anything recognized had a 'continue' above */
* End:
*
* ex: set ts=8 sts=4 sw=4 noet:
- */
\ No newline at end of file
+ */
effect since 5005 threads were removed, and will be removed in the next major
release of Perl 5.
+=item Attribute "unique" is deprecated
+
+(D deprecated) You have used the attributes pragam to modify the "unique"
+attribute on a array, hash or scalar reference. The :unique attribute is has
+had no no effect since Perl 5.8.8, and will be removed in the next major
+release of Perl 5.
+
=item Bad arg length for %s, is %d, should be %s
(F) You passed a buffer of the wrong size to one of msgctl(), semctl()
my @code = qw(lvalue method);
-my @other = qw(shared unique);
-my @deprecated = qw(locked);
+my @other = qw(shared);
+my @deprecated = qw(locked unique);
my %valid;
$valid{CODE} = {map {$_ => 1} @code};
$valid{SCALAR} = {map {$_ => 1} @other};
$valid{ARRAY} = $valid{HASH} = $valid{SCALAR};
my %deprecated;
$deprecated{CODE} = { locked => 1 };
+$deprecated{ARRAY} = $deprecated{HASH} = $deprecated{SCALAR} = { unique => 1 };
our ($scalar, @array, %hash);
foreach my $value (\&foo, \$scalar, \@array, \%hash) {