in reply to Re^9: what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ?
in thread what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ?
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ?
by wazoox (Prior) on Mar 08, 2006 at 12:38 UTC | |
by adrianh (Chancellor) on Mar 09, 2006 at 10:50 UTC | |
by wazoox (Prior) on Mar 09, 2006 at 15:04 UTC | |
by adrianh (Chancellor) on Mar 10, 2006 at 14:22 UTC | |
by wazoox (Prior) on Mar 10, 2006 at 15:46 UTC |