Class::MOP::Method::Wrapped(3pm) User Contributed Perl Documentation
Class::MOP::Method::Wrapped — Method Meta Object for methods with before/after/around modifiers
| Use Case | Command | Description |
|---|---|---|
| 🔧 Wrap a method | Class::MOP::Method::Wrapped->wrap($metamethod, %options) | Wrap an existing method with modifier support |
| ➕ Add before modifier | $metamethod->add_before_modifier($code) | Add a subroutine to run before the original method |
| ➕ Add after modifier | $metamethod->add_after_modifier($code) | Add a subroutine to run after the original method |
| 🔄 Add around modifier | $metamethod->add_around_modifier($code) | Add a subroutine that wraps the original method |
| 📄 Get original method | $metamethod->get_original_method | Retrieve the original wrapped method object |
| 📋 List before modifiers | $metamethod->before_modifiers | Return list of before modifier coderefs |
| 📋 List after modifiers | $metamethod->after_modifiers | Return list of after modifier coderefs |
| 📋 List around modifiers | $metamethod->around_modifiers | Return list of around modifier coderefs |
version 2.2200
This is a Class::MOP::Method subclass which implements before, after, and around method modifiers.
Class::MOP::Method::Wrapped->wrap($metamethod, %options)This is the constructor. It accepts a Class::MOP::Method object and a hash of options.
The options are:
Class::MOP::Method object if it is not provided.Class::MOP::Method object if it is not provided.Class::MOP::Class object. This is the metaclass for the method's class.$metamethod->get_original_methodThis returns the Class::MOP::Method object that was passed to the constructor.
$metamethod->add_before_modifier($code) — Apply a subroutine as a before modifier to the original method.$metamethod->add_after_modifier($code) — Apply a subroutine as an after modifier to the original method.$metamethod->add_around_modifier($code) — Apply a subroutine as an around modifier to the original method.These methods all take a subroutine reference and apply it as a modifier to the original method.
$metamethod->before_modifiers — Returns a list of subroutine references which are acting as before modifiers.$metamethod->after_modifiers — Returns a list of subroutine references which are acting as after modifiers.$metamethod->around_modifiers — Returns a list of subroutine references which are acting as around modifiers.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.
Generated by phpman v4.9.26-5-g7740029 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-12 23:47 @216.73.217.60
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)