in reply to a question on namespaces and inheritance

Why don't you move to MotherClass those methods from ChildClass1 that you want ChildClass2 also to have?

You are confusing two rather different ways to use modules. Expressions like

MotherClass::ChildClass1::object_method(@_)
are "procedural", not OO; mixing procedural and OO calling conventions will cause you grief.

the lowliest monk

Replies are listed 'Best First'.
Re^2: a question on namespaces and inheritance
by ysth (Canon) on Jun 03, 2005 at 18:56 UTC
    mixing procedural and OO calling conventions will cause you grief
    Maybe in general, but in this specific case it's entirely appropriate.

      I have to disagree. For one thing, it is hard to base an exception on the particulars of such a generic case as the one the OP presented, but more importantly, in the context of a question on inheritance, it makes no sense to me to switch over to procedural calling, which disables inheritance. If at some point someone decides to get rid of M::C1::object_method, thereby letting instances of M::C1 use M::object_method instead, then this will break M::C2::object_method as defined by the OP.

      the lowliest monk