Think about Loose Coupling | |
PerlMonks |
Failing inheritance or what can make a Child disinherited ?by guha (Priest) |
on Aug 02, 2004 at 18:16 UTC ( [id://379356]=perlquestion: print w/replies, xml ) | Need Help?? |
guha has asked for the wisdom of the Perl Monks concerning the following question: I am writing tests for a module Child which inherits from Parent, and have run into a oddity which I can't grasp. These modules are part of a larger framework and it is pretty difficult to strip it down to a non-working snippet of code. However these are the facts before the crime:
Either of or
emits the following error The testSign method is only defined in the Parent class. So whats going on, to me it looks like inheritance does not occur even though the prerequsites seem fulfilled. Hints, ptrs, wild shots in the dark greatly appreciated!
update: Thanks adrianh & ysth for spotting my transcription error. Sort of Solved:Added a method Fubar to Parent. And tested with that, and now it worked. So obviously there was something special with the testSign name. A little searching revealed the testSign was referenced in Child like so
I'm not sure but does this act as a declaration for sub testSign in Child namespace ala ysth's and Ovid's suggestions? But in that case the testSign in Child ought to have been invoked as a method instead ?
Back to
Seekers of Perl Wisdom
|
|