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

That assumes that the data IS shared, and I don't think it is... In this case parent's data is different from child's data.
  • Comment on Re: Re[5]: Inheritance and objects tied to a database

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

      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!