in reply to Object Inheritance in Perl

Well, your immediate problems are solved by changing the line in Adres::addPerson from

$self->{@persons[$self->getPersonCount()]}=$aPerson;

to

push @{$self->{persons}}, $aPerson;

and the line in Adres::printProperties from

$self->{@persons[$counter]}->printProperties();

to

$self->{persons}[$counter]->printProperties();

But there are a number of other problems waiting to happen in this code. I recommend rereading perlreftut, perlboot and perltoot before going too much further.

--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me