MooseX...tructor(3pm)
π MooseX::NonMoose::Meta::Role::Constructor β the manual page, bestie edition
okay so you're looking at MooseX...tructor(3pm) from the User Contributed Perl Documentation, and the full glow-up name is MooseX::NonMoose::Meta::Role::Constructor β it's the constructor method trait for MooseX::NonMoose. yes ma'am. π
β¨ NAME β¨
MooseX::NonMoose::Meta::Role::Constructor β constructor method trait for MooseX::NonMoose. that's the whole name section, short and iconic, we love a concise queen π
π¦ VERSION π¦
version 0.27 β that's the one, no cap.
πΈ SYNOPSIS πΈ
okay so here's the whole vibe, copied exactly, character for character, because we do NOT mess with code in this house:
package My::Moose;
use Moose ();
use Moose::Exporter;
Moose::Exporter->setup_import_methods;
sub init_meta {
shift;
my %options = @_;
Moose->init_meta(%options);
Moose::Util::MetaRole::apply_metaclass_roles(
for_class => $options{for_class},
metaclass_roles => ['MooseX::NonMoose::Meta::Role::Class'],
constructor_class_roles =>
['MooseX::NonMoose::Meta::Role::Constructor'],
);
return Moose::Util::find_meta($options{for_class});
}
likeβ¦ look at her go. she's setting up an exporter, running init_meta, and applying metaclass roles via Moose::Util::MetaRole::apply_metaclass_roles β with for_class set to $options{for_class}, metaclass_roles set to ['MooseX::NonMoose::Meta::Role::Class'], and constructor_class_roles set to ['MooseX::NonMoose::Meta::Role::Constructor']. then she returns Moose::Util::find_meta($options{for_class}). periodt. π
π DESCRIPTION π
so basically, this trait implements inlining of the constructor for classes that are using the MooseX::NonMoose::Meta::Role::Class metaclass trait.
π¨ IMPORTANT BESTIE ALERT π¨ β this trait has no effect unless that trait is also used. it's a duo. a package deal. a two-piece. if MooseX::NonMoose::Meta::Role::Class isn't in the mix, this one is justβ¦ sitting there, doing nothing, minding its business. π
for the full tea, go read those docs and the docs for MooseX::NonMoose. they said it, not me. π«Ά
π AUTHOR π
- Original author: Jesse Luehrs
<doy@tozt.net> - Current maintainer: Graham Ollis
<plicease@cpan.org>
two icons, one legacy. we stan. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2009-2025 by Jesse Luehrs.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
π SEE ALSO π
ngl the original page didn't hand me a SEE ALSO section, so there's nothing extra to list here β but the DESCRIPTION does point you at the docs for the MooseX::NonMoose::Meta::Role::Class metaclass trait and the docs for MooseX::NonMoose, so those are your reading list, bestie. πβ¨
and that's the whole page!! mwah π this was generated by perl v5.40.0 on 2025-01-11, and it lives in the User Contributed Perl Documentation as MooseX...tructor(3pm). thanks for reading, go inline a constructor, slay responsibly. π¦ππΈ
π¦ where this page comes from
- debian trixie: libmoosex-nonmoose-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-nonmoose-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-nonmoose-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms