MooseX::Util(3pm)
π MooseX::Util β the manual page, but make it a group chat π
okay bestie so this is MooseX::Util(3pm) from the User Contributed Perl Documentation section, and it's literally about to make your whole Moose life easier. sit down, hydrate, let's go π«Ά
β¨ VERSION β¨
This doc describes version 0.006 of MooseX::Util β released June 26, 2015 as part of MooseX-Util. yes it's giving vintage. it's still iconic. π
β¨ SYNOPSIS β¨
use MooseX::Util qw{ ensure_all_roles with_traits };
# profit!
that's it. that's the whole vibe. # profit! ππ
β¨ DESCRIPTION β¨
so this is a utility module and it handles all of the same functions that Moose::Util handles. in fact, most of the functions this package exports are simply re-exports from Moose::Util β so bestie, you are recommended to go read that module's documentation for the full comprehensive picture. no cap.
However.
We've re-implemented a number of the functions our parent provides, for a variety of reasons (aesthetic reasons, mostly, but like, valid ones). Those functions are documented right here, below, and they're the main characters. π
β¨ FUNCTIONS β¨
πΈ with_traits(<classname> => (<trait1>, ... ))
Given a class and one or more traits, we construct an anonymous class that is a subclass of the given class and consumes the traits given. β¨
This is exactly the same as with_traits in Moose::Util, except that we use create_anon_class in MooseX::Util::Meta::Class to construct the anonymous class, rather than create_anon_class in Moose::Meta::Class directly. that distinction is the whole point, bestie, don't skip it.
Essentially, this means that when we do:
my $anon_class_name = with_traits('Zombie::Catcher', 'SomeTrait');
For $anon_class_name we get:
Zombie::Catcher::__ANON__::SERIAL::1
Rather than:
Moose::Meta::Class::__ANON__::SERIAL::1
This is nice because we have an idea of where the first anonymous class came from, whereas the second one could be from anywhere. it's giving found-family vs. mysterious-origin. π¦
π
is_private
# true if "private"
... if is_private('_some_name');
Ofttimes we need to determine if a name is considered "private" or not. (say it with me: ofttimes.) By convention, method, attribute, and other names are considered private if their first character is an underscore.
While trivial to test for, this allows us to centralize the tests in one place. one place! singular! organized! slay. π
β¨ SEE ALSO β¨
Please see those modules/websites for more information related to this module. π
Moose::Util
β¨ BUGS β¨
Please report any bugs or feature requests on the bugtracker website:
https://github.com/RsrchBoy/moosex-util/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. like, help us reproduce it bestie, we can't fix a vibe we can't see π
β¨ AUTHOR β¨
Chris Weyl <cweyl@alumni.drew.edu>
π I'm a material boy in a material world π
Please note I do not expect to be gittip'ed or flattr'ed for this work β rather it is simply a very pleasant surprise. I largely create and release works like this because I need them or I find it enjoyable; however, don't let that stop you if you feel like it ;)
- Flattr:
https://flattr.com/submit/auto?user_id=RsrchBoy&url=https%3A%2F%2Fgithub.com%2FRsrchBoy%2Fmoosex-util&title=RsrchBoy's%20CPAN%20MooseX-Util&tags=%22RsrchBoy's%20MooseX-Util%20in%20the%20CPAN%22 - Gratipay:
https://gratipay.com/RsrchBoy/ - or indulge my Amazon Wishlist:
http://bit.ly/rsrchboys-wishlist
... If and only if you so desire. π«Ά
β¨ COPYRIGHT AND LICENSE β¨
This software is Copyright (c) 2012 by Chris Weyl.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
and that's the whole page, bestie!! π this was MooseX::Util from perl v5.34.0, dated 2022-06-16, under the MooseX::Util(3pm) manual name. mwah, go consume some traits, ily πβ¨π
π¦ where this page comes from
- debian bookworm: libmoosex-util-perl 0.006-2 Β· LGPL-2.1-only
- debian trixie: libmoosex-util-perl 0.006-2 Β· LGPL-2.1-only
- ubuntu noble: libmoosex-util-perl 0.006-2 Β· LGPL-2.1-only
- ubuntu resolute: libmoosex-util-perl 0.006-2 Β· LGPL-2.1-only
- ubuntu stonking: libmoosex-util-perl 0.006-2 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms