Moose::...structor(3)

πŸ¦‹ NAME πŸ¦‹

Moose::Meta::Method::Destructor β€” Method Meta Object for destructors πŸ’–

(also hi, this page lives in the User Contributed Perl Documentation, just so you know where you are bestie πŸŽ€)


✨ VERSION ✨

version 2.4000


πŸ’… DESCRIPTION πŸ’…

okay so real talk: this class is a subclass of Class::MOP::Method::Inlined, and what it does is bring Moose-specific functionality for inlining destructors. that's the whole vibe. πŸ’«

and like, to actually understand this class, you gotta go read the Class::MOP::Method::Inlined documentation too. both of them. together. it's giving required reading but it's worth it, i promise 🫢


πŸ‘‘ INHERITANCE πŸ‘‘

Moose::Meta::Method::Destructor is a subclass of Moose::Meta::Method and Class::MOP::Method::Inlined.

two parents, no notes, iconic lineage fr fr 🌈


πŸ”₯ METHODS πŸ”₯

Moose::Meta::Method::Destructor->new(%options)

this one constructs a new object for you ✨ and here's what it'll accept:

  • package_name β€” the package for the class in which the destructor is being inlined. this option is required, bestie, do not skip it πŸ’€
  • name β€” the name of the destructor method. also required. two required options, that's just the rules πŸ™ˆ
  • metaclass β€” the metaclass for the class this destructor belongs to. this one's optional! because you can always set it later by calling $metamethod->attach_to_class. lowkey flexible of it πŸ’…

Moose::Meta;:Method::Destructor->is_needed($metaclass)

(not me copy-pasting that semicolon β€” that is literally what the page says, i don't make the rules 😭)

hand it a Moose::Meta::Class object and it hands you back a boolean telling you whether the class needs a destructor. and the tea is: if the class or any of its parents defines a DEMOLISH method, then yeah, it needs a destructor. periodt. πŸ’―


πŸ› BUGS πŸ›

See "BUGS" in Moose for details on reporting bugs. go tell them, they wanna know 🫢


🌸 AUTHORS 🌸

look at this lineup. absolute legends, every single one πŸ‘‘

  • 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>

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 software slay, go wild, just keep the terms bestie πŸ’œ


and that's the whole page!! πŸ¦‹βœ¨ this was written against perl v5.42.0 and dated 2025-07-25 β€” thanks for reading all the way to the bottom, you're the real main character πŸ’–πŸŽ€

πŸ“¦ where this page comes from