in reply to Class data and inheritance

This is a classic problem, and the classical solution is to have another method in the base class which returns the $db value.

package IDObject; my $db; sub set_db { $db = shift; } sub get_db { return $db }
Then in the derived class you simply do this:
sub fix_it { my $this = shift; my $what = shift; my $results = $this->get_db->search($what); . . }

Replies are listed 'Best First'.
Re: Re: Class data and inheritance
by joe++ (Friar) on Nov 07, 2002 at 14:50 UTC
    ...so you just created an access method, which is probably the best solution anyway! ++jdporter

    --
    Cheers, Joe