3 our $VERSION = '0.0.1';
7 sub import { $package = $_[1] }
8 use Filter::Simple sub { s/^/package $package;\nuse Moose;\n/; }
10 1; # Magic true value required at end of module
15 oose - syntactic sugar to make Moose Onliners easier
20 This document describes oose version 0.0.1
25 perl -Moose=Foo -e 'has bar => ( is=>q[ro], default => q[baz] ); print Foo->new->bar' # prints baz
29 oose.pm is a Source filter that simply adds C<package $name; use Moose;> to the beginning of your script
30 and was entirely created because typing perl -e'package Foo; use Moose; ...' was annoying me.
34 oose provides exactly one method and it's automically called by perl:
40 pass a package name to import to be used by the source filter
44 =head1 CONFIGURATION AND ENVIRONMENT
46 =for author to fill in:
47 A full explanation of any configuration system(s) used by the
48 module, including the names and locations of any configuration
49 files, and the meaning of any environment variables or properties
50 that can be set. These descriptions must also include details of any
51 configuration language used.
53 oose requires no configuration files or environment variables.
57 =for author to fill in:
58 A list of all the other modules that this module relies upon,
59 including any restrictions on versions, and an indication whether
60 the module is part of the standard Perl distribution, part of the
61 module's distribution, or must be installed separately. ]
63 You will need L<Filter::Simple> and eventually L<Moose>
66 =head1 INCOMPATIBILITIES
68 =for author to fill in:
69 A list of any modules that this module cannot be used in conjunction
70 with. This may be due to name conflicts in the interface, or
71 competition for system or program resources, or due to internal
72 limitations of Perl (for example, many modules that use source code
73 filters are mutually incompatible).
75 None reported. But it is a source filter and might have issues there.
77 =head1 BUGS AND LIMITATIONS
79 =for author to fill in:
80 A list of known problems with the module, together with some
81 indication Whether they are likely to be fixed in an upcoming
82 release. Also a list of restrictions on the features the module
83 does provide: data types that cannot be handled, performance issues
84 and the circumstances in which they may arise, practical
85 limitations on the size of data sets, special cases that are not
88 No bugs have been reported.
90 Please report any bugs or feature requests to
91 C<bug-oose@rt.cpan.org>, or through the web interface at
92 L<http://rt.cpan.org>.
97 Chris Prather C<< <perigrin@cpan.org> >>
100 =head1 LICENCE AND COPYRIGHT
102 Copyright (c) 2007, Chris Prather C<< <perigrin@cpan.org> >>. All rights reserved.
104 This module is free software; you can redistribute it and/or
105 modify it under the same terms as Perl itself. See L<perlartistic>.
108 =head1 DISCLAIMER OF WARRANTY
110 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
111 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
112 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
113 PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
114 EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
115 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
116 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
117 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
118 NECESSARY SERVICING, REPAIR, OR CORRECTION.
120 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
121 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
122 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
123 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
124 OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
125 THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
126 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
127 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
128 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF