laziness, impatience, and hubris | |
PerlMonks |
Inheritance - parent of parent (solved)by jockel (Beadle) |
on Nov 22, 2007 at 23:31 UTC ( [id://652460]=perlquestion: print w/replies, xml ) | Need Help?? |
jockel has asked for the wisdom of the Perl Monks concerning the following question: Hello all Monks
I've been banging my head for a few hours now and I really need some input from others.. For this example, say I have 3 classes. CLASS_A CLASS_B CLASS_C
I want the inheritance to look like this. CLASS_C ISA CLASS_B ISA CLASS_A
So that if I want to access a method in CLASS_A I want to be able to do.
So,, this is where i'm stuck..
I start from the bottom...
Code for CLASS_C
Code for CLASS_B
Code for CLASS_A
What I know: Everything fails into a endless loop because of the call to SUPER::new inside CLASS_B definition calls itself... But how should I write it?
Regards Joakim UPDATE: I had a call inside CLASS_B::new which called a 'CLASS_C::new' which in turn called CLASS_B::new again .. forever.. Apperently I were to tired yesterday when trying this.. But I guess it's not a waste, hopefully this post will help someone in the future =)
Back to
Seekers of Perl Wisdom
|
|