use strict; use warnings; use Human; my $grandma = Human->new( eye_color => [ 'blue', 'blue', 'blue', 'blue' ], gender => 'f', ); my $grandpa = Human->new( eye_color => [ 'brown', 'blue', 'blue', 'blue' ], gender => 'm', ); my $bill = $grandma + $grandpa; my $annette = Human->new( eye_color => ['brown', 'brown', 'green', 'blue'], gender => 'f', ); my $jessica = $bill + $annette; my $aran = Human->new( eye_color => [ 'blue', 'blue', 'blue', 'blue' ], gender => 'm', ); my $ula = $aran + $jessica; my $stat_indent = 0; stat_human( $ula ); sub stat_human { my $human = shift; foreach my $gene (qw( bey2_1 bey2_2 gey_1 gey_2 )) { print "$gene: " . $human->eye_color->$gene->color() . ' '; } print '= [ ' . $human->eye_color->color() . " ]\n\n"; $stat_indent ++; if ($human->mother()) { print '' . (' ' x $stat_indent) . 'Mother: '; stat_human( $human->mother() ); } if ($human->father()) { print '' . (' ' x $stat_indent) . 'Father: '; stat_human( $human->father() ); } $stat_indent --; }