#!/usr/bin/perl -w
package B;
package C;
sub new {
my ($self, %args) = @_;
print "C::new\n";
bless { %args },
ref($self) || $self;
}
package E;
sub new {
my ($self, %args) = @_;
print "E::new\n";
bless { %args };
}
package F;
package G;
@ISA = qw(E C);
|
package A;
@ISA = qw(B C);
package D;
@ISA = qw(E F G);
sub new {
my ($self, %args) = @_;
print "D::new\n";
bless
{ %args }, ref($self) || $self;
}
package H;
@ISA = qw(A D);
package main;
my $a = H->new();
print ref($a),"\n";
my $b = G->new();
print ref($b),"\n";
|