1 #define PERL_NO_GET_CONTEXT
9 if (strnEQ(attr, "method", 6))
11 else if (strnEQ(attr, "locked", 6))
17 MODULE = attrs PACKAGE = attrs
27 Perl_croak(aTHX_ "Usage: %s(Class, ...)", GvNAME(CvGV(cv)));
28 if (!PL_compcv || !(cv = CvOUTSIDE(PL_compcv)))
29 croak("can't set attributes outside a subroutine scope");
30 if (ckWARN(WARN_DEPRECATED))
31 Perl_warner(aTHX_ WARN_DEPRECATED,
32 "pragma \"attrs\" is deprecated, "
33 "use \"sub NAME : ATTRS\" instead");
34 for (i = 1; i < items; i++) {
36 char *attr = SvPV(ST(i), n_a);
37 cv_flags_t flag = get_flag(attr);
39 croak("invalid attribute name %s", attr);
52 if (SvTYPE(sub) != SVt_PVCV)
57 char *name = SvPV(sub, n_a);
58 sub = (SV*)perl_get_cv(name, FALSE);
61 croak("invalid subroutine reference or name");
62 if (CvFLAGS(sub) & CVf_METHOD)
63 XPUSHs(sv_2mortal(newSVpvn("method", 6)));
64 if (CvFLAGS(sub) & CVf_LOCKED)
65 XPUSHs(sv_2mortal(newSVpvn("locked", 6)));