Well if you want to change your configuration depending upon the context, then of course you don't want a singleton... which is all about never changing (or overriding) anything wherever you are.
No it isn't. A singleton is about there only ever being one instance of a class. Nothing wrong with having a singleton instance whose state you can change.
Of course it's globals in disguise, but it's globals on steroids too, because you can share your globals across packages as needed :)
Of course you can share globals across packages.
{ package Foo; $foo = 1; } { package Bar; print $Foo::foo, "\n"; }
In reply to Re^10: what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ?
by adrianh
in thread what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ?
by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |