If that's the case, and you can call the $self->Parent::DESTROY to save the child data, why not undef the parent's data at the same time, and add if defined around the untie?
That way when the DESTROY method gets called for the parent, it finds that the data is undefd, and does nothing.
Alternatively, always untie the parent's data first, then the child's, again testing defined and that should get you round the problem.
Not sure if either of those methodologies are the best, though.
Hope that helps -- Foxcub | [reply] [d/l] [select] |
That would probably work. Basically you arrived at the same solution suggested by gjb. I am not sure if it's the best way of doing it either. I just don't know how it's usually done. It does seem to solve my original problem though - so that's cool. Thank you!
| [reply] |