package Population; use Animal; # constructor sub new { my $this = {}; # object properties $this->{individual} = []; bless $this; return $this; } sub init { for ($i=0; $i<5; $i++) { my $empl = Animal->new(); $empl->setDNA(4, 6, 8, 10); push (@{$this->{individual}}, $empl); } }