=encoding euc-jp =head1 NAME =begin original attributes - get/set subroutine or variable attributes =end original attributes - �ѿ��㤷���ϴؿ���°�������/���� =head1 SYNOPSIS sub foo : method ; my ($x,@y,%z) : Bent = 1; my $s = sub : method { ... }; use attributes (); # optional, to get subroutine declarations # Ǥ��, �ؿ������. my @attrlist = attributes::get(\&foo); use attributes 'get'; # import the attributes::get subroutine # attributes::get �ؿ��Υ���ݡ���. my @attrlist = get \&foo; =head1 DESCRIPTION =begin original Subroutine declarations and definitions may optionally have attribute lists associated with them. (Variable C declarations also may, but see the warning below.) Perl handles these declarations by passing some information about the call site and the thing being declared along with the attribute list to this module. In particular, the first example above is equivalent to the following: =end original �ؿ������������ǤϤ���˴�Ϣ����°���Υꥹ�Ȥ�Ǥ�դǻ��Ĥ��Ȥ� �Ǥ��ޤ�. (�ѿ��� C �����Ǥ��ޤ���, ��Ҥηٹ�⻲�Ȥ��� ��������.) Perl �Ϥ����������, �ƤӽФ�����°���ꥹ�Ȥ� �Ȥ���������褦�Ȥ��Ƥ����Τξ���򤳤Υ⥸�塼����Ϥ����Ȥ� �����������������ޤ�. �ä�, ��κǽ����ϼ��Τ�Τ������Ǥ�: use attributes __PACKAGE__, \&foo, 'method'; =begin original The second example in the synopsis does something equivalent to this: =end original 2���ܤγ��פˤ�����ϡ����������Ǥ�: use attributes (); my ($x,@y,%z); attributes::->import(__PACKAGE__, \$x, 'Bent'); attributes::->import(__PACKAGE__, \@y, 'Bent'); attributes::->import(__PACKAGE__, \%z, 'Bent'); ($x,@y,%z) = 1; =begin original Yes, that's a lot of expansion. =end original �����Ǥ�¿����Ÿ�����ʤ���ޤ�. =begin original B: attribute declarations for variables are still evolving. The semantics and interfaces of such declarations could change in future versions. They are present for purposes of experimentation with what the semantics ought to be. Do not rely on the current implementation of this feature. =end original B<�ٹ�>: �ѿ����Ф���°��������Ϥޤ�������Ӿ�ˤ���ޤ�. ����������ΰ�̣�ȥ��󥿡��ե������Ϻ���ΥС������� �ѹ�������ǽ��������ޤ�. �����Ϻ��夯���̣���θ����� �Τ���Ū�Ȥ����󶡤���Ƥ��ޤ�. ���ε�ǽ�θ��ߤμ����ˤ� ���ʤ��Ǥ�������. =begin original There are only a few attributes currently handled by Perl itself (or directly by this module, depending on how you look at it.) However, package-specific attributes are allowed by an extension mechanism. (See L<"Package-specific Attribute Handling"> below.) =end original ���� Perl ����(�㤷���ϸ����ˤ�äƤϤ��Υ⥸�塼�뤬ľ��)�� ���������°���Ϥ鷺���Ǥ�. ������, ����ѥå������Ѥ�°���Ȥ��� ��Τ���ĥ�ᥫ�˥���Ȥ��ƻȤ����Ȥ��Ǥ��ޤ�. (��Ҥ� L<"Package-specific Attribute Handling">�򻲾Ȥ��Ƥ�������.) =begin original The setting of subroutine attributes happens at compile time. Variable attributes in C declarations are also applied at compile time. However, C variables get their attributes applied at run-time. This means that you have to I the run-time component of the C before those attributes will get applied. For example: =end original �ؿ���°��������ϥ���ѥ�����˵����ޤ�. C ����Ǥ��ѿ�°���� ����ѥ������Ŭ�Ѥ���ޤ�. ������, C �ѿ��ϼ¹Ի���°���� Ŭ�Ѥ��Ԥ��ޤ�. �����°����Ŭ�Ѥ�������� C �μ¹Ի������� I<��ã>���ʤ���Фʤ�ʤ����Ȥ��̣���ޤ�. �㤨��: my $x : Bent = 42 if 0; =begin original will neither assign 42 to $x I will it apply the C attribute to the variable. =end original �� $x �� 42 ���������뤳��I<��>�ѿ��� C °����Ŭ�Ѥ���� ���Ȥ⤢��ޤ���. =begin original An attempt to set an unrecognized attribute is a fatal error. (The error is trappable, but it still stops the compilation within that C.) Setting an attribute with a name that's all lowercase letters that's not a built-in attribute (such as "foo") will result in a warning with B<-w> or C. =end original �Τ�ʤ�°�����������̿Ū�ʥ��顼�Ȥʤ�ޤ�. (���Υ��顼�� �ȥ�åפǤ��ޤ���, ���� C ����ǥ���ѥ������ߤ��ޤ�.) ���Ƥ���ʸ������ʤ뤱����Ȥ߹��ߤ�°���ǤϤʤ�̾��(�㤨�С�foo") �����ꤹ��� B<-w> �㤷���� C �Ǥ� �ٹ��ȯ�����ޤ�. =begin original =head2 What C does =end original =head2 C ���Ԥ����� =begin original In the description it is mentioned that =end original �ܤ���������, ����������ԤäƤ��뤳�Ȥ� sub foo : method; =begin original is equivalent to =end original ���������Ǥ�. use attributes __PACKAGE__, \&foo, 'method'; =begin original As you might know this calls the C function of C at compile time with these parameters: 'attributes', the caller's package name, the reference to the code and 'method'. =end original ���餯���ΤäƤ���褦��, �����C �� C �ؿ��� ����ѥ�����˰ʲ��Υѥ�᡼���ǸƤӽФ��ޤ�: 'attributes', �ƤӽФ����Υѥå�����̾, �����ɤؤΥ�ե���󥹵ڤ� 'method'. attributes->import( __PACKAGE__, \&foo, 'method' ); =begin original So you want to know what C actually does? =end original ������ C ���ºݤ˲�����äƤ��뤫���Τꤿ������ä�? =begin original First of all C gets the type of the third parameter ('CODE' in this case). C checks if there is a subroutine called C<< MODIFY__ATTRIBUTES >> in the caller's namespace (here: 'main'). In this case a subroutine C is required. Then this method is called to check if you have used a "bad attribute". The subroutine call in this example would look like =end original �ޤ��ǽ�� C �ϣ����ܤΥѥ�᡼���η���������ޤ�(���Υ������Ǥ���� 'CODE'). C �� C<< MODIFY__ATTRIBUTES >> �Ȥ����ؿ����ƤӽФ��� (�����Ǥ� 'main')�ˤ��뤫��Ĵ�٤ޤ�. ����� C ���ǧ���ޤ�.�����Ƥ��� �᥽�åɤ�"�ְ�ä�°��"��ȤäƤ��ʤ�����Ĵ�٤뤿��˸ƤӽФ��ޤ�. ���δؿ��ƤӽФ��ϼ��Τ褦�ˤʤ�ޤ�: MODIFY_CODE_ATTRIBUTES( 'main', \&foo, 'method' ); =begin original C<< MODIFY__ATTRIBUTES >> has to return a list of all "bad attributes". If there are any bad attributes C croaks. (See L<"Package-specific Attribute Handling"> below.) =end original C<< MODIFY__ATTRIBUTES >> ��"�ְ�ä�°��"�Υꥹ�Ȥ��֤��ʤ���Фʤ�ޤ���. �⤷�ʤ�餫�δְ�ä�°��������� C �� croak ���ޤ�. (��Ҥ� L<"Package-specific Attribute Handling"> �򻲾�.) =begin original =head2 Built-in Attributes =end original =head2 �Ȥ߹��ߤ�°�� =begin original The following are the built-in attributes for subroutines: =end original �ʲ��Τ�Τϴؿ��Ѥ��Ȥ߹���°���Ǥ� =over 4 =item lvalue =begin original Indicates that the referenced subroutine is a valid lvalue and can be assigned to. The subroutine must return a modifiable value such as a scalar variable, as described in L. =end original ���Ȥ��줿�ؿ��Ϻ�����(lvalue)�Ȥ���ͭ���Ǥ���������ǽ�Ǥ��� ���Ȥ򼨤��ޤ�. �ؿ��� L ����������Ƥ���褦�� �ѹ����뤳�ȤΤǤ�����, �㤨�Х����顼�ѿ������֤��ʤ���� �ʤ�ޤ���. =begin original This module allows one to set this attribute on a subroutine that is already defined. For Perl subroutines (XSUBs are fine), it may or may not do what you want, depending on the code inside the subroutine, with details subject to change in future Perl versions. You may run into problems with lvalue context not being propagated properly into the subroutine, or maybe even assertion failures. For this reason, a warning is emitted if warnings are enabled. In other words, you should only do this if you really know what you are doing. You have been warned. =end original ���Υ⥸�塼�������Ѥߤδؿ���,����°�������ꤹ�뤳�Ȥ�����ޤ�. Perl�δؿ�(XSUBs�������)�ˤȤä�,�����,�ؿ���Υ����ɤ˰�¸����, ���ʤ���˾�ळ�Ȥ򤹤뤫�⤷��ʤ���,���ʤ����⤷��ޤ���. �ܺ٤Ͼ����Perl�ΥС��������ѹ�������ǽ��������ޤ�. �ؿ����Ф���,Ŭ�ڤǤʤ� lvalue ����ƥ����Ȥ�Ȥ���,���꤫,¿ʬ,���ԤΥ������Ȥ� �֤�������Ǥ��礦.���������櫓��,warnings��ͭ���ˤ��Ƥ����,�ٹ�ȯ�����ޤ�(���� �����餯5.16.0�ʹ�). �����������,��ʬ�����򤷤Ƥ��뤫�����ˤ狼�äƤ�����Τߤ�, ����򤹤٤��Ǥ�.�ٹ𤷤ޤ��������. =item method =begin original Indicates that the referenced subroutine is a method. A subroutine so marked will not trigger the "Ambiguous call resolved as CORE::%s" warning. =end original ���Ȥ��줿�ؿ��ϥ᥽�åɤǤ���� �󼨤��ޤ�. ����ǥޡ������줿�ؿ��� "Ambiguous call resolved as CORE::%s" (CORE::%s�Ȥ��ƽ��������ۣ��ʸƤӽФ��˷ٹ��ȯ�������ޤ���. =item locked =begin original The "locked" attribute has no effect in 5.10.0 and later. It was used as part of the now-removed "Perl 5.005 threads". =end original "locked"°���� 5.10.0�ʹߤDz��ⵯ���ޤ���.�����,���Ϻ�����줿"Perl 5.005 threads" �ΰ����Ȥ��ƻȤ��Ƥ��ޤ���. =back =begin original =head2 Available Subroutines =end original =head2 �󶡤���Ƥ���ؿ� =begin original The following subroutines are available for general use once this module has been loaded: =end original �ʲ��δؿ��ϰ���Ū�ʻ��ѤΤ���ˤ��Υ⥸�塼�������� �����Ȥ����󶡤���ޤ�. =over 4 =item get =begin original This routine expects a single parameter--a reference to a subroutine or variable. It returns a list of attributes, which may be empty. If passed invalid arguments, it uses die() (via L) to raise a fatal exception. If it can find an appropriate package name for a class method lookup, it will include the results from a C_ATTRIBUTES> call in its return list, as described in L<"Package-specific Attribute Handling"> below. Otherwise, only L will be returned. =end original ���Υ롼����ϣ��ĤΥѥ�᡼�� -- �ؿ��㤷�����ѿ��ؤΥ�ե���󥹤� �������ޤ�. ������°���ΰ������֤��ޤ�, ����϶����⤷��ޤ���. �������ʤ��������Ϥ�������, ��̿Ū���㳰���ꤲ�뤿��� (L ���̤���) die() ��ƤӽФ��ޤ�. �⤷�᥽�å�õ����Ŭ�ڤʥѥå�����̾�򸫤Ĥ��뤳�Ȥ����褿�Τʤ�, ��Ҥ� L<"Package-specific Attribute Handling"> �ˤ���褦�� �����֤����ꥹ�Ȥ� C<< FETCH_I_ATTRIBUTES >> ����� ��̤�ޤ�ޤ�. �����Ǥʤ���� L<�Ȥ߹��ߤ�°��|"Built-in Attributes">�Τߤ��֤���ޤ�. =item reftype =begin original This routine expects a single parameter--a reference to a subroutine or variable. It returns the built-in type of the referenced variable, ignoring any package into which it might have been blessed. This can be useful for determining the I value which forms part of the method names described in L<"Package-specific Attribute Handling"> below. =end original ���δؿ��ϣ��ĤΥѥ�᡼�� -- �ؿ��㤷�����ѿ��ؤΥ�ե���󥹤� �������ޤ�. ����� bless ����Ƥ����Ȥ��Ƥ�ѥå�����̾�� ̵�뤷��, ���Ȥ���Ƥ����ѿ����Ȥ߹��߷����֤��ޤ�. ����ϸ�Ҥ� L<"Package-specific Attribute Handling"> �� ��������Ƥ���᥽�å�̾�ΰ����������� I �ͤ���ꤹ��Τ� �����Ǥ�. =back =begin original Note that these routines are I exported by default. =end original �����δؿ��ϥǥե���ȤǤϥ������ݡ��Ȥ���I<�ޤ���>. =begin original =head2 Package-specific Attribute Handling =end original =head2 �ѥå������̤�°������ =begin original B: the mechanisms described here are still experimental. Do not rely on the current implementation. In particular, there is no provision for applying package attributes to 'cloned' copies of subroutines used as closures. (See L for information on closures.) Package-specific attribute handling may change incompatibly in a future release. =end original B<�ٹ�>: ��������������Ƥ���ᥫ�˥����̤���¸��ʳ��Ǥ�. ���ߤμ��������Ƥˤ��ʤ��Ǥ�������. �ä�, ����������Ȥ��� �Ȥ��Ƥ���ؿ��� 'clone���줿' ʣ�����Ф��� �ѥå�����°����Ŭ�Ѥ˴ؤ��Ƥϲ������Ϥ���ޤ���. (����������˴ؤ���ܺ٤� L �򻲾�.) �ѥå������̤�°�������Ϻ��٤Υ�꡼���Ǹߴ����ʤ����ѹ�������ǽ��������ޤ�. =begin original When an attribute list is present in a declaration, a check is made to see whether an attribute 'modify' handler is present in the appropriate package (or its @ISA inheritance tree). Similarly, when C is called on a valid reference, a check is made for an appropriate attribute 'fetch' handler. See L<"EXAMPLES"> to see how the "appropriate package" determination works. =end original �����°���ꥹ�Ȥ����ꤵ��Ƥ����, Ŭ�ڤʥѥå�����(�㤷���Ϥ��� @ISA �Ѿ��ĥ꡼)����� °��'�ѹ�(modify)'�ϥ�ɥ餬���Ĥ��뤫�ɤ�����ǧ���ޤ�. Ʊ���褦��, ͭ���ʥ�ե���󥹤��Ф��� C �� �ƤӽФ���, Ŭ�ڤ�'����(fetch)'�ϥ�ɥ���ǧ���ޤ�. "Ŭ�ڤʥѥå�����"���ɤΤ褦�˷��ꤵ��뤫�� L<"EXAMPLES"> �� ���Ȥ��Ƥ�������. =begin original The handler names are based on the underlying type of the variable being declared or of the reference passed. Because these attributes are associated with subroutine or variable declarations, this deliberately ignores any possibility of being blessed into some package. Thus, a subroutine declaration uses "CODE" as its I, and even a blessed hash reference uses "HASH" as its I. =end original �ϥ�ɥ�̾���������褦�Ȥ��Ƥ��ѿ��㤷�����Ϥ��줿��ե���󥹤� ���򸵤ˤ��Ƥ��ޤ�. ������°���ϴؿ��㤷�����ѿ�������� ��Ϣ�Ť����Ƥ��뤿��, ����Ϥɤ����Υѥå������� bless ����褦�Ȥ��Ƥ� ��ǽ����ΰդ�̵�뤷�Ƥ��ޤ�. ���äƴؿ�����Ϥ��� I �� "CODE" ��Ȥ�, �֥쥹���줿�ϥå����ե���󥹤Ǥ��äƤ⤽�� I �� "HASH" ��Ȥ��ޤ�. =begin original The class methods invoked for modifying and fetching are these: =end original �ѹ��㤷���ϼ����˸ƤӽФ���륯�饹�᥽�åɤˤϰʲ���ʪ������ޤ�: =over 4 =item FETCH_I_ATTRIBUTES =begin original This method is called with two arguments: the relevant package name, and a reference to a variable or subroutine for which package-defined attributes are desired. The expected return value is a list of associated attributes. This list may be empty. =end original ���Υ᥽�åɤϣ��Ĥΰ����ǸƤӽФ���ޤ�: ��Ϣ����ѥå�����̾ �ڤӥѥå��������������°������˾�����ѿ��㤷���ϴؿ��ؤΥ�ե����. ͽ�����������ͤϴ�Ϣ�Ť���줿°���Υꥹ�ȤǤ�. �ꥹ�Ȥ϶��ˤʤ뤳�Ȥ⤢��ޤ�. =item MODIFY_I_ATTRIBUTES =begin original This method is called with two fixed arguments, followed by the list of attributes from the relevant declaration. The two fixed arguments are the relevant package name and a reference to the declared subroutine or variable. The expected return value is a list of attributes which were not recognized by this handler. Note that this allows for a derived class to delegate a call to its base class, and then only examine the attributes which the base class didn't already handle for it. =end original ���Υ᥽�åɤϣ��Ĥθ���ΰ�����, ��Ϣ������������°���Υꥹ�Ȥ�ȼ�ä� �ƤӽФ���ޤ�. ���Ĥθ�������ϴ�Ϣ����ѥå�����̾��������줿 �ؿ��㤷�����ѿ��Ǥ�. ͽ�����������ͤϤ��Υϥ�ɥ��ǧ������ʤ��ä� °���Υꥹ�ȤǤ�. ������������饹�����쥯�饹�ؤθƤӽФ������� ���뤳�Ȥ��Ǥ�, ���θ�ǤΤߴ��쥯�饹�����˽�����Ԥ�ʤ��ä� °���򸡺��Ǥ��ޤ�. =begin original The call to this method is currently made I the processing of the declaration. In particular, this means that a subroutine reference will probably be for an undefined subroutine, even if this declaration is actually part of the definition. =end original ���Υ᥽�åɤθƤӽФ��ϸ��ߤ�����ν�����I<�֤�>�Ԥ��ޤ�. �ä�, ����Ϥ���������ºݤ�����ΰ����Ǥ��ä��Ȥ��Ƥ� �ؿ���ե���󥹤�̤����δؿ����⤷��ʤ����Ȥ��̣���ޤ�. =back =begin original Calling C from within the scope of a null package declaration C for an unblessed variable reference will not provide any starting package name for the 'fetch' method lookup. Thus, this circumstance will not result in a method call for package-defined attributes. A named subroutine knows to which symbol table entry it belongs (or originally belonged), and it will use the corresponding package. An anonymous subroutine knows the package name into which it was compiled (unless it was also compiled with a null package declaration), and so it will use that package name. =end original null �ѥå�������� C �Υ������פǥ֥쥹����Ƥ��ʤ��ѿ��ؤ� ��ե���󥹤�ȼ�ä� C �ƤӽФ���Ԥä����, �����'����(fetch)'�᥽�å�õ���Τ���γ��ϥѥå�����̾���� ���ޤ���. ���ä�, ���ξ��֤Ǥϥѥå����������°���Τ���Υ᥽�åɸƤӽФ��ˤ� �ʤ�ޤ���. ̾���դ��δؿ��Ϥ��줬��°����(�㤷���Ϻǽ�˽�°���Ƥ���) ����ܥ�ơ��֥륨��ȥ���ΤäƤ���Τ�, ������б�����ѥå�������Ȥ��ޤ�. ̵̾�ؿ��Ϥ��줬����ѥ��뤵�줿�ѥå�����̾��(������ null �ѥå���������� ���ä����������)�ΤäƤ���Τ�, ���Υѥå�����̾��Ȥ��ޤ�. =begin original =head2 Syntax of Attribute Lists =end original =head2 °���ꥹ�Ȥι�ʸ =begin original An attribute list is a sequence of attribute specifications, separated by whitespace or a colon (with optional whitespace). Each attribute specification is a simple name, optionally followed by a parenthesised parameter list. If such a parameter list is present, it is scanned past as for the rules for the C operator. (See L.) The parameter list is passed as it was found, however, and not as per C. =end original °���ꥹ�Ȥϥ��ڡ����㤷���ϥ�����(�Ⱦ�ά��ǽ�ʥ��ڡ���)�Ƕ��ڤ�줿 °��������¤ӤǤ�. ���줾���°�������ñ���̾����, ��ά��ǽ�ʳ�̤ǰϤޤ줿�ѥ�᡼���ꥹ�Ȥ�³���ޤ�. �⤷�ѥ�᡼���ꥹ�Ȥ��󶡤���Ƥ����, ����� C �黻�ҤΥ롼��� ������󤵤�ޤ�. (L ����.) �ѥ�᡼���ꥹ�Ȥϸ��Ĥ��ä��ޤ��Ϥ���ޤ���, C �ˤ��ޤ���. =begin original Some examples of syntactically valid attribute lists: =end original ��ʸŪ��������°���ꥹ�ȤΤ����Ĥ�����: switch(10,foo(7,3)) : expensive Ugly('\(") :Bad _5x5 lvalue method =begin original Some examples of syntactically invalid attribute lists (with annotation): =end original ��ʸŪ���������ʤ�°���ꥹ�ȤΤ����Ĥ�����(������): switch(10,foo() # ()-string not balanced Ugly('(') # ()-string not balanced 5x5 # "5x5" not a valid identifier Y2::north # "Y2::north" not a simple identifier foo + bar # "+" neither a colon nor whitespace =head1 EXPORTS =begin original =head2 Default exports =end original =head2 �ǥե���ȤΥ������ݡ��� =begin original None. =end original �ʤ�. =begin original =head2 Available exports =end original =head2 �󶡲�ǽ�ʥ������ݡ��� =begin original The routines C and C are exportable. =end original C �ڤ� C ���������ݡ��Ȳ�ǽ�Ǥ�. =begin original =head2 Export tags defined =end original =head2 �������Ƥ��륨�����ݡ��ȥ��� =begin original The C<:ALL> tag will get all of the above exports. =end original C<:ALL> ���������ҤΥ������ݡ��ȴؿ����Ƥ���Ф��ޤ�. =head1 EXAMPLES =begin original Here are some samples of syntactically valid declarations, with annotation as to how they resolve internally into C invocations by perl. These examples are primarily useful to see how the "appropriate package" is found for the possible method lookups for package-defined attributes. =end original ��ʸŪ������������Τ����Ĥ�����Ȥ���餬 perl �ˤ�ä� �ɤΤ褦�� C �ƤӽФ��Ȥʤ뤫������. ���������"Ŭ�ڤʥѥå�����"���ɤ���äƥѥå��������°���Τ���� �᥽�å�õ���ΰ٤˸��Ĥ��Ф���뤫�򸫤�Τ˼����Ω���ޤ�. =over 4 =item 1. =begin original Code: =end original ������: package Canine; package Dog; my Canine $spot : Watchful ; =begin original Effect: =end original ����: use attributes (); attributes::->import(Canine => \$spot, "Watchful"); =item 2. =begin original Code: =end original ������: package Felis; my $cat : Nervous; =begin original Effect: =end original ����: use attributes (); attributes::->import(Felis => \$cat, "Nervous"); =item 3. =begin original Code: =end original ������: package X; sub foo : lvalue ; =begin original Effect: =end original ����: use attributes X => \&foo, "lvalue"; =item 4. =begin original Code: =end original ������: package X; sub Y::x : lvalue { 1 } =begin original Effect: =end original ����: use attributes Y => \&Y::x, "lvalue"; =item 5. =begin original Code: =end original ������: package X; sub foo { 1 } package Y; BEGIN { *bar = \&X::foo; } package Z; sub Y::bar : lvalue ; =begin original Effect: =end original ����: use attributes X => \&X::foo, "lvalue"; =back =begin original This last example is purely for purposes of completeness. You should not be trying to mess with the attributes of something in a package that's not your own. =end original �Ǹ����Ͻ��˴������Τ�������Ǥ�. ��ʬ�Τ�ΤǤʤ��ѥå������β��餫��°���ˤ���ä���������٤��ǤϤ���ޤ���. =begin original =head1 MORE EXAMPLES =end original =head1 ��ä��� =over 4 =item 1. sub MODIFY_CODE_ATTRIBUTES { my ($class,$code,@attrs) = @_; my $allowed = 'MyAttribute'; my @bad = grep { $_ ne $allowed } @attrs; return @bad; } sub foo : MyAttribute { print "foo\n"; } =begin original This example runs. At compile time C is called. In that subroutine, we check if any attribute is disallowed and we return a list of these "bad attributes". =end original �������ư��ޤ�. ����ѥ������ C ���ƤӽФ���ޤ�. ���δؿ��Dz��餫��°�������Ĥ���Ƥ��ʤ�����Ĵ�٤� �����"�ְ�ä�°��"�Υꥹ�Ȥ��֤��ޤ�. =begin original As we return an empty list, everything is fine. =end original ���Υꥹ�Ȥ��֤����Τʤ�, ��������פǤ�. =item 2. sub MODIFY_CODE_ATTRIBUTES { my ($class,$code,@attrs) = @_; my $allowed = 'MyAttribute'; my @bad = grep{ $_ ne $allowed }@attrs; return @bad; } sub foo : MyAttribute Test { print "foo\n"; } =begin original This example is aborted at compile time as we use the attribute "Test" which isn't allowed. C returns a list that contains a single element ('Test'). =end original ������ϵ��Ĥ��Ƥ��ʤ�°�� "Test" ��ȤäƤ��뤿��˼¹Ի��˥��ܡ��Ȥ��ޤ�. C �ϣ��Ĥ�����('Test')��ޤ���ꥹ�Ȥ��֤��ޤ�. =back =head1 SEE ALSO =begin original L and L for details on the basic declarations; L for details on the normal invocation mechanism. =end original ����Ū������ξܺ٤� L �ڤ� L �̾�θƤӽФ������ξܺ٤� L. =head1 ���� ���� ɹ�� (YAMASHINA Hio) (5.8.9) Kato Atsushi (5.14.2-) =begin meta Translate: YAMASHINA Hio Update: Kato Atsushi (5.14.2-) Status: completed =end meta