man > Class::MOP::Instance

πŸ“› NAME

Class::MOP::Instance - Instance Meta Object

πŸš€ Quick Reference

Use CaseCommandDescription
Create meta‑instanceClass::MOP::Instance->new(%options)Build a new instance meta‑object for a class
Create an actual instance$metainstance->create_instanceReturn a blessed reference into the associated class
Clone an instance$metainstance->clone_instance($instance)Shallow copy of an existing object
Get a slot value$metainstance->get_slot_value($inst, $slot)Read the value stored in a named slot
Set a slot value$metainstance->set_slot_value($inst, $slot, $val)Write a value into a slot
Check slot initialisation$metainstance->is_slot_initialized($inst, $slot)Test whether a slot has been initialised
Weaken a slot reference$metainstance->weaken_slot_value($inst, $slot)Make the slot’s value a weak reference
Rebless an instance$metainstance->rebless_instance_structure($inst, $new_meta)Change the class of an existing instance
Inline instance creation$metainstance->inline_create_instance('$class')Generate code that creates an object cheaply

πŸ“ 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 all expect two arguments. The first is the name of a variable that, when inlined, will represent the object instance. Typically this will be a literal string like '$_[0]'. The second argument is a slot name. The method returns a snippet of code that, when inlined, performs some operation on the instance.

πŸ” 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.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 17:27 @2600:1f28:365:80b0:f8a4:e764:d6bb:8e66
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^