I want to be able to set some_var here. I get error Global symbol "$some_var" requires explicit package name. Isnt inheritance supposed to get the variable into MyObject??CommonObject.pm my $some_var; #constructor sub new{ my $class=shift; my $self = {} ; bless $self, $class; print Dumper($self); return $self; } MyObject.pm our @ISA = qw( CommonObject ); sub new{ my $class=shift; $testName=shift; my $self = CommonObject->new(); $self->some_var="abcd"; return $self; }
In reply to Re^2: Data inheritance
by perlbaski
in thread Data inheritance
by perlbaski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |