MooseX...eClass(3pm)
π MooseX::Types::LoadableClass π
okay bestie, welcome to the User Contributed Perl Documentation for MooseX::Types::LoadableClass, and trust me, this one is a whole vibe. it's a ClassName type constraint that coerces into actually loading the class. no cap. π
β¨ NAME β¨
MooseX::Types::LoadableClass β ClassName type constraint with coercion to load the class. π
πΈ VERSION πΈ
version 0.016 β yes, the number matters, don't @ me.
π¦ SYNOPSIS π¦
like, look how cute this is:
package MyClass;
use Moose;
use MooseX::Types::LoadableClass qw/ LoadableClass /;
has foobar_class => (
is => 'ro',
required => 1,
isa => LoadableClass,
);
MyClass->new(foobar_class => 'FooBar'); # FooBar.pm is loaded or an
# exception is thrown.
so you hand it the string 'FooBar', and it goes and loads FooBar.pm for you. if that fails? exception. thrown. immediately. no survivors. π
π DESCRIPTION π
the origin story, fr fr:
use Moose::Util::TypeConstraints;
my $tc = subtype as ClassName;
coerce $tc, from Str, via { Class::Load::load_class($_); $_ };
the author literally says: "I've written those three lines of code quite a lot of times, in quite a lot of places."
and then: "Now I don't have to."
periodt. that's the whole motivation. iconic behavior honestly. π
π«Ά TYPES EXPORTED π«Ά
"LoadableClass"
a normal class / package. that's it. that's the type. simple, clean, slay. β¨
"LoadableRole"
like "LoadableClass", except the loaded package must be a Moose::Role. so if you try to sneak a regular class in there, it's not gonna fly, bestie. π«
π SUPPORT π
found a bug? (rude, but okay.) bugs may be submitted through the RT bug tracker here:
https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types-LoadableClass
or you can email bug-MooseX-Types-LoadableClass@rt.cpan.org π
there's also a mailing list for users of this distribution, hanging out at http://lists.perl.org/list/moose.html π
and there's an irc channel too, for the real ones: "#moose" on "irc.perl.org" β irc://irc.perl.org/#moose π¬
π AUTHOR π
Tomas Doran <bobtfish@bobtfish.net> β the main character who wrote this. π
π CONTRIBUTORS π
these legends showed up and helped:
- Karen Etheridge
<ether@cpan.org> - Dagfinn Ilmari MannsΓ₯ker
<ilmari@ilmari.org> - Florian Ragwitz
<rafl@debian.org> - Graham Knop
<haarg@haarg.org> - Gregory Oschwald
<goschwald@maxmind.com> - Π‘Π΅ΡΠ³Π΅ΠΉ Π ΠΎΠΌΠ°Π½ΠΎΠ²
<sromanov@cpan.org>
not me being obsessed with the whole squad π₯Ή
β COPYRIGHT AND LICENCE β
This software is copyright (c) 2010 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. π so go wild, legally. π
and that's the whole page, bestie!! π this was perl v5.40.1, dated 2025-04-24, and it's genuinely giving iconic manpage energy. go load some classes. iykyk. π¦πβ¨
π¦ where this page comes from
- debian trixie: libmoosex-types-loadableclass-perl 0.016-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-types-loadableclass-perl 0.016-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-types-loadableclass-perl 0.016-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