oose(3)
β¨ oose β¨
okay bestie, so this is oose(3) from the User Contributed Perl Documentation, and it's literally the cutest little thing β syntactic sugar to make Moose one-liners easier π
π VERSION π
version 2.4000 β she's giving established, she's giving stable, periodt π
πΈ SYNOPSIS πΈ
# create a Moose class on the fly ...
perl -Moose=Foo -e 'has bar => ( is=>q[ro], default => q[baz] ); print Foo->new->bar' # prints baz
# loads an existing class (Moose or non-Moose)
# and re-"opens" the package definition to make
# debugging/introspection easier
perl -Moose=+My::Class -e 'print join ", " => __PACKAGE__->meta->get_method_list'
# also loads Moose::Util::TypeConstraints to allow subtypes etc
perl -Moose=Person -e'subtype q[ValidAge] => as q[Int] => where { $_ > 0 && $_ < 78 }; has => age ( isa => q[ValidAge], is => q[ro]); Person->new(age => 90)'
like, that last one is so unhinged and I'm obsessed with it π
π¦ DESCRIPTION π¦
oose.pm is a simple source filter, no cap. What it does is it adds this lil' incantation to the beginning of your script:
package $name; use Moose; use Moose::Util::TypeConstraints;
and the whole reason it exists? Because typing perl -e'package Foo; use Moose; ...' was annoying the author. That's it. That's the origin story. main character energy fr fr πβ¨
π INTERFACE π
oose provides exactly one method, and perl calls it automatically for you β she doesn't need an invitation, she just shows up π
import($package)β Pass a package name toimportand it'll be used by the source filter. If you don't give one, the package defaults toClass. generous queen π«Ά
π§ DEPENDENCIES π§
You will need Filter::Simple, and eventually Moose π
π INCOMPATIBILITIES π
None reported. But listen β it is a source filter, so likeβ¦ it might have issues there. Not me being dramatic, that's just the vibe of source filters π
π BUGS π
See "BUGS" in Moose for details on reporting bugs. go off, file that ticket bestie π
π AUTHORS π
- 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>
a whole friend group of icons, we love to see it π
πΈ COPYRIGHT AND LICENSE πΈ
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.
and that's the whole page, bestie π this one came to you courtesy of perl v5.42.0, dated 2025-07-25 β love that for us, slay β¨π
π¦ where this page comes from
- fedora 43: perl-Moose 2.4000-4.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms