in reply to Re: Problem with Inheriting a Super Class
in thread Problem with Inheriting a Super Class
Hello Chromatic,
Thanks for your reply. I tried both 'our @ISA' and 'my @ISA' without change to the apparent behavior. Now trying with use parent I am receiving the same results.
What really blows my mind, is when I dump the object itself it shows the correct parameters, when I use the object methods to call the parameters is when I am seeing incorrect results.
With that in mind, could this be what is causing my problems?
# create accessor methods for defined parameters for my $datum (keys %{$self}) { no strict "refs"; *$datum = sub { shift; # XXX: ignore calling class/object $self->{$datum} = shift if @_; return $self->{$datum}; }; }
Since this is loaded in the SNMPMonitor::Plugin package, but then inherited to SNMPMonitor::Plugin::Atest (and subsequently Btest) could Btest be overwriting the methods in the symbol table?
After I just typed that I attempted to remove the line :
which had no effect.shift; # XXX: ignore calling class/object
Even better, (to add to what blows my mind), when I use the methods to access the data I am seeing this bug, when I access the variables directly, I do not have this issue.
...
This must mean that it is an issue with my method of creating accessors for the object, right?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Problem with Inheriting a Super Class
by chromatic (Archbishop) on Sep 19, 2011 at 21:45 UTC | |
by PyrexKidd (Monk) on Sep 20, 2011 at 00:00 UTC | |
by chromatic (Archbishop) on Sep 20, 2011 at 05:12 UTC | |
by PyrexKidd (Monk) on Sep 20, 2011 at 20:12 UTC | |
by chromatic (Archbishop) on Sep 20, 2011 at 21:43 UTC | |
by Anonymous Monk on Sep 20, 2011 at 00:21 UTC |