|Perl: the Markov chain saw
Making an Existing Class a Singletonby agianni (Hermit)
|on Jan 23, 2008 at 16:41 UTC
agianni has asked for the wisdom of the Perl Monks concerning the following question:
I have a config class for my Web application, and for a number of reasons, I think it would be useful to make it a singleton class. Unfortunately, it's already set up, has a standard interface and inherits from Class::Accessor. I know about Class::Singleton, but it doesn't look like there would be any easy way to take an existing class and make it a singleton class with that.
Short of encapsulating my current config object in a new singleton class, can anyone suggest a way to accomplish this?