NAME
OOP::Perlish::Class::Singleton
DESCRIPTION
Create a singleton class. Only one instance of this class will ever exist, no matter how many times a call is made to OOP::Perlish::Class::Singleton->new(); The first call will create the instance, and all subsequent calls will receive references to that first instance.
Note that all arguments passed to the constructor after initial object instantiation will be ignored. This can produce circumstances where the behavior of the singleton not what was expected in certain portions of code. For this reason, Singletons should usually be stateless and/or read-only, and not have required accessors.
DIAGNOSTICS
This module will $self->debug() diagnostics; run with instance, class, or global debugging enabled (as described in OOP::Perlish::Class) in development.
- 'Singleton of ' . $class . ' already initialized; NOT reinitialized!!'
-
This means that more than one call to OOP::Perlish::Class::Singleton->new(%args) was made with arguments, and the arguments were ignored the second time.