No such thing as a small change | |
PerlMonks |
Re: Garbage collected class attributes with inside out classes.by xdg (Monsignor) |
on Mar 02, 2007 at 01:55 UTC ( [id://602811]=note: print w/replies, xml ) | Need Help?? |
There's an extra variable that you can't get rid of but also isn't part of the core functionality So? It's a single scalar. And arguably, it is part of the core functionality -- if you define garbage collection of class variables to recover memory as core. The other options I thought about involved weak references but that's really just another mechanism for doing what you're doing in #1. Overall -- an interesting meditation. To some extent, I question whether this is really a "class attribute" in the usual sense of the term, as it only exists when objects exist, but that's just quibbling over names. -xdg Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In Section
Meditations
|
|