info > Class::MOP::Instance

📖 NAME

Class::MOP::Instance - Instance Meta Object

🚀 Quick Reference

Use CaseCommandDescription
Create a new meta-instance objectClass::MOP::Instance->new(%options)Creates a meta-instance with associated metaclass and attributes
Create an object instance$metainstance->create_instanceReturns a reference blessed into the class
Clone an instance$metainstance->clone_instance($instance)Shallow clone of an existing instance
Get slot value$metainstance->get_slot_value($instance_structure, $slot_name)Retrieve attribute value from instance
Set slot value$metainstance->set_slot_value($instance_structure, $slot_name, $value)Set attribute value in instance
Inline instance creation$metainstance->inline_create_instance($class_variable)Returns code snippet for inlined object creation
Check if operations are inlinable$metainstance->is_inlinableBoolean indicating whether slot access can be inlined (default true)

đŸˇī¸ VERSION

version 2.2200

📝 DESCRIPTION

The Instance Protocol controls the creation of object instances, and the storage of attribute values in those instances.

Using this API directly in your own code violates encapsulation, and we recommend that you use the appropriate APIs in Class::MOP::Class and Class::MOP::Attribute instead. Those APIs in turn call the methods in this class as appropriate.

This class also participates in generating inlined code by providing snippets of code to access an object instance.

🔧 METHODS

đŸ› ī¸ Object construction

đŸŽ¯ Creating and altering instances

🔍 Introspection

âš™ī¸ Operations on Instance Structures

It's important to understand that the meta-instance object is a different entity from the actual instances it creates. For this reason, any operations on the $instance_structure always require that the object instance be passed to the method.

The exact details of what each method does should be fairly obvious from the method name.

⚡ Inlinable Instance Operations

These methods expect two arguments: the variable name representing the object instance (e.g., '$_[0]') and a slot name. They return a code snippet for the inlined operation.

🔍 Introspection

đŸ‘Ĩ AUTHORS

ÂŠī¸ COPYRIGHT AND LICENSE

This software is copyright (c) 2006 by Infinity Interactive, Inc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Class::MOP::Instance
📖 NAME 🚀 Quick Reference đŸˇī¸ VERSION 📝 DESCRIPTION 🔧 METHODS
đŸ› ī¸ Object construction đŸŽ¯ Creating and altering instances 🔍 Introspection âš™ī¸ Operations on Instance Structures ⚡ Inlinable Instance Operations 🔍 Introspection
đŸ‘Ĩ AUTHORS ÂŠī¸ COPYRIGHT AND LICENSE

Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-16 08:58 @2600:1f28:365:80b0:7cb9:fb:26c1:e368
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!