> How the heck does Class::Singleton do it's voodoo ?? I understand that the > instance() method looks for a reference to the _instance variable in the > proper package. If it is there, it just returns it, otherwise it calls > _new_instance to create an object of the proper class. BUT, where does the > _instance variable ever get created within the proper package namespace ???
It sounds like you understand it just fine. This being Perl, the global variable $_instance is just auto-vivified the first time it gets assigned to by instance(). The name of the package (which is the first arg to instance() when called as a class method) is prepended to the $_instance variable name. - Perrin
