http://qs321.pair.com?node_id=17874

package Life; @ISA=qw(Girl);
package Girl; @ISA=qw(Life);

So please help me, give me some assistance,
I need to use them both,
without ending up in a recursive inheritance.

/brother t0mas

Replies are listed 'Best First'.
RE: Recursive inheritance
by Corion (Patriarch) on Jun 13, 2000 at 16:12 UTC

    Uhoh !

    Except for abstracting the interfaces and splitting up both Life and Girl, I don't see much chance for you.

    My proposition assumes that Girl needs certain aspects of Life, which in turn needs certain (other) aspects of Girl. So you should create a third package, Base, which has all the functions Girl needs to work, and then you can have package Life; @ISA=qw(Girl); (or the other way around.

    Yes, this will be complicated and require rethinking of the interfaces and object structure. No, there is no other way (at least I don't see it). Sorry ;)

RE: Recursive inheritance
by Crulx (Monk) on Jun 15, 2000 at 07:56 UTC
    Even more perlish/catch-22ish..
    package Life; require Girl; package Girl; require Life;

    ---
    Crulx
    crulx@iaxs.net
RE: Recursive inheritance
by reptile (Monk) on Jun 14, 2000 at 02:44 UTC

    Call me strange but I think that's beautiful :p I know exactly what that is like. I'll probably get voted down for posting this dumb 'me too' post but I don't care I just had to say it.

    Thanks for posting that, t0mas. It was really clever and I always appreciate a programming analogy to the facts of life.

    72656B636148206C72655020726568746F6E41207473754A