M
Mintcake
There are 5 small files in this example:
foo.pl: use p4;
p1.pm: package p1; use fields qw(a b); 1;
p2.pm: package p2; use base 'p1'; 1;
p3.pm: package p3; use base 'p1'; 1;
p4.pm: package p4; use base qw(p2 p3); 1;
When I compile foo.pl I get the following error:
Can't multiply inherit %FIELDS at /home/tony/Projects/bin/p4.pm 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.
foo.pl: use p4;
p1.pm: package p1; use fields qw(a b); 1;
p2.pm: package p2; use base 'p1'; 1;
p3.pm: package p3; use base 'p1'; 1;
p4.pm: package p4; use base qw(p2 p3); 1;
When I compile foo.pl I get the following error:
Can't multiply inherit %FIELDS at /home/tony/Projects/bin/p4.pm 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.