my $instance = MyApp->instance(@optional_init_args);
my $same = MyApp->instance;
DESCRIPTIONRole::Tiny role that provides ``instance'' method turning your object into singleton.
my $singleton = MyApp->instance(@args1); my $same = MyApp->instance; # @args2 are ignored my $above = MyApp->instance(@args2);
Creates a new object initialized with arguments provided and then returns it.
NOTE: Subsequent calls to "instance" will return the singleton instance ignoring any arguments. This is different from MooseX::Singleton which does not allow any arguments.
AUTHORAlex J. G. BurzyXski <[email protected]>
COPYRIGHT AND LICENSEThis software is copyright (c) 2012 by Alex J. G. BurzyXski <[email protected]>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.