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:
39 pass a package name to import to be used by the source filter
43 =head1 CONFIGURATION AND ENVIRONMENT
45 =for author to fill in:
46 A full explanation of any configuration system(s) used by the
47 module, including the names and locations of any configuration
48 files, and the meaning of any environment variables or properties
49 that can be set. These descriptions must also include details of any
50 configuration language used.
52 oose requires no configuration files or environment variables.
56 =for author to fill in:
57 A list of all the other modules that this module relies upon,
58 including any restrictions on versions, and an indication whether
59 the module is part of the standard Perl distribution, part of the
60 module's distribution, or must be installed separately. ]
62 You will need L<Filter::Simple> and eventually L<Moose>
65 =head1 INCOMPATIBILITIES
67 =for author to fill in:
68 A list of any modules that this module cannot be used in conjunction
69 with. This may be due to name conflicts in the interface, or
70 competition for system or program resources, or due to internal
71 limitations of Perl (for example, many modules that use source code
72 filters are mutually incompatible).
74 None reported. But it is a source filter and might have issues there.
76 =head1 BUGS AND LIMITATIONS
78 =for author to fill in:
79 A list of known problems with the module, together with some
80 indication Whether they are likely to be fixed in an upcoming
81 release. Also a list of restrictions on the features the module
82 does provide: data types that cannot be handled, performance issues
83 and the circumstances in which they may arise, practical
84 limitations on the size of data sets, special cases that are not
87 No bugs have been reported.
89 Please report any bugs or feature requests to
90 C<bug-oose@rt.cpan.org>, or through the web interface at
91 L<http://rt.cpan.org>.
96 Chris Prather C<< <perigrin@cpan.org> >>
99 =head1 LICENCE AND COPYRIGHT
101 Copyright (c) 2007, Chris Prather C<< <perigrin@cpan.org> >>. All rights reserved.
103 This module is free software; you can redistribute it and/or
104 modify it under the same terms as Perl itself. See L<perlartistic>.
107 =head1 DISCLAIMER OF WARRANTY
109 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
110 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
111 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
112 PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
113 EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
114 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
115 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
116 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
117 NECESSARY SERVICING, REPAIR, OR CORRECTION.
119 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
120 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
121 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
122 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
123 OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
124 THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
125 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
126 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
127 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF