9 $VERSION = eval $VERSION;
10 our $AUTHORITY = 'cpan:STEVAN';
15 $package = $_[1] || 'Class';
16 if ($package =~ /^\+/) {
18 Class::MOP::load_class($package);
21 use Filter::Simple sub { s/^/package $package;\nuse Moose;\n/; }
32 oose - syntactic sugar to make Moose one-liners easier
36 # create a Moose class on the fly ...
37 perl -Moose=Foo -e 'has bar => ( is=>q[ro], default => q[baz] ); print Foo->new->bar' # prints baz
39 # loads an existing class (Moose or non-Moose)
40 # and re-"opens" the package definition to make
41 # debugging/introspection easier
42 perl -Moose=+My::Class -e 'print join ", " => __PACKAGE__->meta->get_method_list'
46 oose.pm is a simple source filter that adds C<package $name; use Moose;>
47 to the beginning of your script and was entirely created because typing
48 C<perl -e'package Foo; use Moose; ...'> was annoying me.
52 oose provides exactly one method and it's automatically called by perl:
56 =item B<import($package)>
58 Pass a package name to import to be used by the source filter.
64 You will need L<Filter::Simple> and eventually L<Moose>
66 =head1 INCOMPATIBILITIES
68 None reported. But it is a source filter and might have issues there.
72 All complex software has bugs lurking in it, and this module is no
73 exception. If you find a bug please either email me, or add the bug
78 Chris Prather C<< <perigrin@cpan.org> >>
80 =head1 COPYRIGHT AND LICENSE
82 Copyright 2007-2009 by Infinity Interactive, Inc.
84 L<http://www.iinteractive.com>
86 This library is free software; you can redistribute it and/or modify
87 it under the same terms as Perl itself.