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 to import and it'll be used by the source filter. If you don't give one, the package defaults to Class. 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 🌟


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