note
perlbaski
So this code isnt working..
<code>
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;
}
</code>
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??
927588
927591