Any::Moose - use Moose or Mouse modules
version 0.09
package Class; # uses Moose if it's loaded, Mouse otherwise use Any::Moose;
package Other::Class; use Any::Moose; # uses Moose::Util::TypeConstraints if the class has loaded Moose, # Mouse::Util::TypeConstraints otherwise. use Any::Moose '::Util::TypeConstraints';
package My::Meta::Class; use Any::Moose; # uses subtype from Moose::Util::TypeConstraints if the class loaded Moose, # subtype from Mouse::Util::TypeConstraints otherwise. # similarly for Mo*se::Util's does_role use Any::Moose ( '::Util::TypeConstraints' => ['subtype'], '::Util' => ['does_role'], ); # uses MouseX::Types use Any::Moose 'X::Types'; # gives you the right class name depending on which Mo*se was loaded extends any_moose('::Meta::Class');
Actual documentation is forthcoming, once we solidify all the bits of the API. The examples above are very likely to continue working.
Shawn M Moore <sartak@bestpractical.com> Florian Ragwitz <rafl@debian.org> Stevan Little <stevan@iinteractive.com> Tokuhiro Matsuno <tokuhirom@gmail.com>
This software is copyright (c) 2009 by Best Practical Solutions.
This is free software; you can redistribute it and/or modify it under the same terms as perl itself.
To install Any::Moose, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Any::Moose
CPAN shell
perl -MCPAN -e shell install Any::Moose
For more information on module installation, please visit the detailed CPAN module installation guide.