Class::...:Wrapped(3)

πŸ’– NAME πŸ’–

Class::MOP::Method::Wrapped β€” the Method Meta Object for methods that have before, after, and around modifiers πŸ’…

(yes bestie, this is a Class::MOP::Method::Wrapped(3) situation, perl v5.42.0, we're in the User Contributed Perl Documentation, let's go ✨)


🌸 VERSION 🌸

version 2.4000 β€” she's grown, she's evolved, she's iconic πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. this is a Class::MOP::Method subclass, right? and what she does is implement before, after, and around method modifiers. that's the whole vibe. that's the assignment and she ATE πŸ“


✨ METHODS ✨

πŸŽ€ Class::MOP::Method::Wrapped->wrap($metamethod, %options)

this is the constructor, bestie β€” the main character entrance πŸ’–

she accepts a Class::MOP::Method object and a hash of options. and the options are… drumroll please πŸ₯

  • name β€” the method name (no package name attached, we keep it simple ✨). if you don't pass it, she'll just yoink it from the Class::MOP::Method object you gave her.
  • package_name β€” the package name for the method. same deal, if you don't provide it, it gets taken from that Class::MOP::Method object you handed over.
  • associated_metaclass β€” an optional Class::MOP::Class object. this is the metaclass for the method's class. optional, so like, no pressure πŸ’…

🌈 $metamethod->get_original_method

this one returns the Class::MOP::Method object that you passed to the constructor. that's it. she's giving "no thoughts, just the original" and honestly? valid 🫢


🌟 $metamethod->add_before_modifier($code) / $metamethod->add_after_modifier($code) / $metamethod->add_around_modifier($code)

these three all do the same lil dance: they take a subroutine reference and apply it as a modifier to the original method. before, after, around β€” pick your fighter, they all slay πŸ”₯


πŸ’œ $metamethod->before_modifiers / $metamethod->after_modifiers / $metamethod->around_modifiers

and these three? they all return a list of subroutine references that are acting as the specified type of modifier. so you ask for the before ones, you get the before ones. you ask for the around ones, you get the around ones. iykyk ✨


πŸ‘‘ AUTHORS πŸ‘‘

the legends themselves, no cap:

  • Stevan Little <stevan@cpan.org>
  • Dave Rolsky <autarch@urth.org>
  • Jesse Luehrs <doy@cpan.org>
  • Shawn M Moore <sartak@cpan.org>
  • Χ™Χ•Χ‘Χœ Χ§Χ•Χ’'מן (Yuval Kogman) <nothingmuch@woobling.org>
  • Karen Etheridge <ether@cpan.org>
  • Florian Ragwitz <rafl@debian.org>
  • Hans Dieter Pearcey <hdp@cpan.org>
  • Chris Prather <chris@prather.org>
  • Matt S Trout <mstrout@cpan.org>

the way that there are TEN of them and every single one is a real one πŸ˜­πŸ’–


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. free as in freedom, bestie πŸ•ŠοΈ


okay that's the whole page, no notes, periodt πŸ’…βœ¨

and that's a wrap (get it? Wrapped? 😭) β€” perl v5.42.0, dated 2025-07-25, filed under Class::...:Wrapped(3) in the User Contributed Perl Documentation. mwah πŸ’–

πŸ“¦ where this page comes from