Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
First, let's get the brokenness out of the way:
Please read ref($proto) - just say no!. Now, it looks like you're enamored with shiny objects. Let's get back to the basics. You want a hash that is in every namespace? Then simply create a module that populates the hash and exports it: And to use it: There. No singleton or tie or any of that junk needed. If that won't suffice, please clarify. Also keep in mind that I hate global data. You should export behavior, not data. You should avoid global data as much as possible, because it creates nasty couplings that keep you from refactoring or reusing or testing code well. -- Randal L. Schwartz, Perl hacker
In reply to Re: Multiple Inheritance - Howto marry tie::refhash::nestable with class::singleton
by merlyn
|
|