Subject: | Demo-code (partially) non-functional |
Demo code :
sub new ($$;$) {
my($class, $attr, $args) = @_;
my($self) = $class->SUPER::new($attr, $args);
if ($self->{'parent'}) {
# Called via Clone()
...
will never work, as a cloned instance never passes the 'new' function.
Inserting print statements in Net::Daemon methods 'new', 'Clone' and
'Run', and in subclass' 'new' and 'Run' methods prove that no 'new'
method is passed by instances made with 'Clone'.
Suggestion:
Make a method i.e. 'initiate-clone', that is called before 'Run', and
that can be overridden in the subclass to perform necessary initiation,
that is now non-functional in the demo-code.