package CommonObject; my @common_array; package MyObject; @ISA = qw( CommonObject ); sub new{ my $class=shift; my $self = {}; bless $self, $class; $self->@common_array=qw(1 2);#This line throws syntax error return $self; }
How do i set array variables in parent class?
I know it has to do with $self being a reference to a hash. But I dont understand what happens if there are global scoped array variables in parent class. How do i access them or set them.In reply to Data inheritance by perlbaski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |