0.33
[gitmo/Moose.git] / lib / oose.pm
CommitLineData
3eca5b1c 1package oose;
25374f01 2
3eca5b1c 3use strict;
25374f01 4use warnings;
5
6our $VERSION = '0.01';
7our $AUTHORITY = 'cpan:STEVAN';
3eca5b1c 8
9BEGIN {
10 my $package;
11 sub import { $package = $_[1] }
12 use Filter::Simple sub { s/^/package $package;\nuse Moose;\n/; }
13}
3eca5b1c 14
25374f01 151;
3eca5b1c 16
25374f01 17__END__
3eca5b1c 18
25374f01 19=pod
3eca5b1c 20
25374f01 21=head1 NAME
3eca5b1c 22
25374f01 23oose - syntactic sugar to make Moose one-liners easier
3eca5b1c 24
25=head1 SYNOPSIS
26
27 perl -Moose=Foo -e 'has bar => ( is=>q[ro], default => q[baz] ); print Foo->new->bar' # prints baz
28
29=head1 DESCRIPTION
30
25374f01 31oose.pm is a simple source filter that adds C<package $name; use Moose;>
32to the beginning of your script and was entirely created because typing
33perl -e'package Foo; use Moose; ...' was annoying me.
3eca5b1c 34
35=head1 INTERFACE
36
37oose provides exactly one method and it's automically called by perl:
1aa48307 38
25374f01 39=over 4
3eca5b1c 40
25374f01 41=item B<import($package)>
3eca5b1c 42
25374f01 43Pass a package name to import to be used by the source filter.
3eca5b1c 44
45=back
46
3eca5b1c 47=head1 DEPENDENCIES
48
3eca5b1c 49You will need L<Filter::Simple> and eventually L<Moose>
50
3eca5b1c 51=head1 INCOMPATIBILITIES
52
3eca5b1c 53None reported. But it is a source filter and might have issues there.
54
25374f01 55=head1 BUGS
3eca5b1c 56
25374f01 57All complex software has bugs lurking in it, and this module is no
58exception. If you find a bug please either email me, or add the bug
59to cpan-RT.
3eca5b1c 60
61=head1 AUTHOR
62
63Chris Prather C<< <perigrin@cpan.org> >>
64
25374f01 65=head1 COPYRIGHT AND LICENSE
3eca5b1c 66
25374f01 67Copyright 2007 by Infinity Interactive, Inc.
3eca5b1c 68
25374f01 69L<http://www.iinteractive.com>
3eca5b1c 70
25374f01 71This library is free software; you can redistribute it and/or modify
72it under the same terms as Perl itself.
3eca5b1c 73
25374f01 74=cut