[perl #18065] LFS related bug in perl-5.8.0 testsuite
[p5sagit/p5-mst-13.2.git] / ext / attrs / attrs.xs
index a92922d..73f100d 100644 (file)
@@ -10,8 +10,6 @@ get_flag(char *attr)
        return CVf_METHOD;
     else if (strnEQ(attr, "locked", 6))
        return CVf_LOCKED;
-    else if (strnEQ(attr, "lvalue", 6))
-       return CVf_LVALUE;
     else
        return 0;
 }
@@ -19,16 +17,20 @@ get_flag(char *attr)
 MODULE = attrs         PACKAGE = attrs
 
 void
-import(Class, ...)
-char * Class
+import(...)
     ALIAS:
        unimport = 1
     PREINIT:
        int i;
-       CV *cv;
     PPCODE:
+       if (items < 1)
+           Perl_croak(aTHX_ "Usage: %s(Class, ...)", GvNAME(CvGV(cv)));
        if (!PL_compcv || !(cv = CvOUTSIDE(PL_compcv)))
            croak("can't set attributes outside a subroutine scope");
+       if (ckWARN(WARN_DEPRECATED))
+           Perl_warner(aTHX_ packWARN(WARN_DEPRECATED),
+                       "pragma \"attrs\" is deprecated, "
+                       "use \"sub NAME : ATTRS\" instead");
        for (i = 1; i < items; i++) {
            STRLEN n_a;
            char *attr = SvPV(ST(i), n_a);