Object...::Field(3pm)
π NAME π
okay so this is the Object...::Field(3pm) page from User Contributed Perl Documentation, and the main character is Object::Pad::MOP::Field β the meta-object representation of a data field of a Object::Pad class. π
β¨
β¨ DESCRIPTION β¨
Instances of this class represent a data field of a class implemented by Object::Pad. The accessors give you info about the field. The special value method lets you access the value of the given field on instances of its class, so the meta-object can be used as a proxy to it. π«Ά
β οΈ This API should be considered experimental, bestie β it will emit warnings to that effect. You can silence them with:
use Object::Pad qw( :experimental(mop) );
π METHODS π
πΈ name πΈ
$name = $metafield->name;
Returns the name of the field, as a plain string including the leading sigil character. No cap. π
π¦ sigil π¦
$sigil = $metafield->sigil;
Since version 0.56.
Returns the first character of the field name, giving just its leading sigil. β¨
π class π
$metaclass = $metafield->class;
Returns the Object::Pad::MOP::Class instance representing the class of which this field is a member. Iconic. π
π₯ value π₯
$current = $metafield->value( $instance );
@current = $metafield->value( $instance );
%current = $metafield->value( $instance );
An accessor method which returns the current value of the field from an object instance. π«
$metafield->value( $instance ) = $new;
On scalar fields, this method can also act as an lvalue mutator allowing a new value to be set. π«Ά
π has_attribute π
$exists = $metafield->has_attribute( $name );
Since version 0.57.
Returns a boolean indicating whether the named attribute has been attached to the field. The attribute name should not include the leading colon (:) character. π«
π get_attribute_value π
$value = $metafield->get_attribute_value( $name );
Since version 0.57.
Returns the stored value of an attached attribute, if one exists. If the attribute has not been attached then an exception is thrown. π
Note that most core-defined attributes will either store no data at all, or a method name string. This accessor method is provided largely for the benefit of obtaining data defined by third-party attributes, which may more clearly define how that data is generated and used. π§
π get_attribute_values π
@values = $metafield->get_attribute_values( $name );
Since version 0.66.
Returns all the stored values of an attached attribute, if one exists. If the attribute has not been attached then an exception is thrown. π
This allows inspection of stored attribute values if it makes meaningful sense for the attribute to be applied multiple times to the same field. This is unlikely to be useful for core-defined attributes, but may be meaningful for third-party attributes. β¨
π«Ά AUTHOR π«Ά
Paul Evans <leonerd@leonerd.org.uk> π
okay bestie, that's the whole page! π This one is from perl v5.42.3, dated 2026-08-22, and it's the Object...::Field(3pm) manual page β slay! π¦π
π¦ where this page comes from
- ubuntu stonking: libobject-pad-perl 0.825-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms