in reply to Re: Re[5]: Inheritance and objects tied to a database
in thread Inheritance and objects tied to a database

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

Replies are listed 'Best First'.
Re: Re[7]: Inheritance and objects tied to a database
by relax99 (Monk) on Dec 20, 2002 at 14:06 UTC
    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!