I like your thinking, but I'd suggest not calling it init. 'reset' or something similar might be a better idea.
It's common practice, when you're dealing with inheritance, to make sure you call all of the init-type functions in the inherited object. (the easiest way is to just call $self->NEXT::_init(), if you're using NEXT
Of course, if you were to use an _init() function as you've described, you'll end up trashing whatever other people have set up, as well.
Ideally, you would just clear out the keys that you were making use of, so you don't end up treading on someone else's toes... but I'd still move the destructive part of the code out to a seperate function that is not called by the _init() or new() routines.
In reply to Re^2: "cleaning out" object data
by jhourcle
in thread "cleaning out" object data
by Forsaken
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |