This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pumpkin.pod: Add L<> around html link
[perl5.git] / ext / attributes / attributes.pm
index 178a126..a7c6716 100644 (file)
@@ -1,6 +1,6 @@
 package attributes;
 
-our $VERSION = 0.14;
+our $VERSION = 0.15;
 
 @EXPORT_OK = qw(get reftype);
 @EXPORT = ();
@@ -34,6 +34,15 @@ sub _modify_attrs_and_deprecate {
            require warnings;
            warnings::warnif('deprecated', "Attribute \"$1\" is deprecated");
            0;
+       } : $svtype eq 'CODE' && /^-?lvalue\z/ ? do {
+           require warnings;
+           warnings::warnif(
+               'misc',
+               "lvalue attribute "
+                  . (/^-/ ? "cannot be removed" : "ignored")
+                  . " after the subroutine has been defined"
+           );
+           0;
        } : 1
     } _modify_attrs(@_);
 }