in reply to How to create a singleton class ?

I'd suggest you just read the source for Class::Singleton. It short. There are only ten-ish lines of actual code. The net effect is, you'll either write a replacement for Class::Singleton or you'll use the real one. The function is just that basic.