in reply to Class data and inheritance

The variable is lexically scoped, so it's not accessible from outside your class. Perhaps declaring it as a package global would do the trick?
our $db