in reply to Re: Extending objects
in thread Extending objects

That's just plain weird. Now you have a parent class that has knowledge how it's subclasses are implemented (as it's the parent class that is storing the attributes the subclasses use). You're going out of your way to break encapsulation.

And how it's going to work anyway? Your $foo is of class FooBar::Foo, which has FooBar in its inheritance tree (that is, assuming you would actually have package statements, which you don't). But then you call the method age, which is defined in FooBar::Bar, which is not inherited by FooBar::Foo.