in reply to Inherited Object Constructor Question
and in SNMPMonitor::Plugin::Atest definesub set_oid { my $self = shift; $self->plugin_oid($self->plugin_oid_val); }
Then you should get the desired behaviour.sub plugin_oid_val { '1.2.5' }
BTW why not use Moose for this? For the purpose of reuse, it seems cleaner to provide set_oid via a role, since a Plugin doesn't seem like a convincing subtype of a SNMPMonitor (e.g. Liskov substitution principle)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Inherited Object Constructor Question
by PyrexKidd (Monk) on Sep 11, 2011 at 23:49 UTC | |
by chromatic (Archbishop) on Sep 12, 2011 at 04:47 UTC | |
by Arunbear (Prior) on Sep 13, 2011 at 14:05 UTC |