GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Object::Pad::MOP::Field(3) User Contributed Perl Documentation Object::Pad::MOP::Field(3)

"Object::Pad::MOP::Field" - meta-object representation of data field of a "Object::Pad" class

Instances of this class represent a data field of a class implemented by Object::Pad. Accessors provide information about the field. The special "value" method allows access to the value of the given field on instances of its class, letting the meta-object be used as a proxy to it.

This API should be considered experimental, and will emit warnings to that effect. They can be silenced with

   use Object::Pad qw( :experimental(mop) );

   $name = $metafield->name

Returns the name of the field, as a plain string including the leading sigil character.

   $sigil = $metafield->sigil

Since version 0.56.

Returns the first character of the field name, giving just its leading sigil.

   $metaclass = $metafield->class

Returns the Object::Pad::MOP::Class instance representing the class of which this field is a member.

   $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.

   $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.

   $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.

Paul Evans <leonerd@leonerd.org.uk>
2022-04-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.