MooseX::DeclareX::Plugin::singleton - shiny syntax for MooseX::Singleton
class Logger is singleton { method log ($str) { ...; } } Logger->instance->log("here we are!");
This distribution extends MooseX::DeclareX with a new plugin:
is singleton
Marks a class as a singleton, providing instance and initialize methods as per MooseX::Singleton.
instance
initialize
Known issue: you may occasionally get errors about inlining the constructor.
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=MooseX-DeclareX-Plugin-singleton.
MooseX::DeclareX, MooseX::Singleton.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2012 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install MooseX::DeclareX::Plugin::singleton, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::DeclareX::Plugin::singleton
CPAN shell
perl -MCPAN -e shell install MooseX::DeclareX::Plugin::singleton
For more information on module installation, please visit the detailed CPAN module installation guide.