in reply to Re: Data inheritance
in thread Data inheritance
So this code isnt working..
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; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Data inheritance
by ikegami (Patriarch) on Sep 23, 2011 at 21:04 UTC | |
by perlbaski (Sexton) on Sep 23, 2011 at 21:15 UTC | |
by ikegami (Patriarch) on Sep 23, 2011 at 21:17 UTC | |
by perlbaski (Sexton) on Sep 23, 2011 at 21:27 UTC | |
by ikegami (Patriarch) on Sep 23, 2011 at 22:47 UTC | |
by perlbaski (Sexton) on Sep 23, 2011 at 21:12 UTC | |
by ikegami (Patriarch) on Sep 23, 2011 at 21:13 UTC |
In Section
Seekers of Perl Wisdom