Multiple inheritance of %FIELDS

Discussion in 'Perl Misc' started by Mintcake, May 13, 2006.

  1. Mintcake

    Mintcake Guest

    There are 5 small files in this example: use p4; package p1; use fields qw(a b); 1; package p2; use base 'p1'; 1; package p3; use base 'p1'; 1; package p4; use base qw(p2 p3); 1;

    When I compile I get the following error:

    Can't multiply inherit %FIELDS at /home/tony/Projects/bin/ line 1

    Now I can see that if both p2 and p3 had introduced additional fileds
    then they would occupy the same space and cause potential runtime
    confusion. But, if only one of the packages p2 and p3 introduced
    additional fields or (as in the above example) neither of them did, it
    ought to work.
    Mintcake, May 13, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.