Skip to content

Demo-code (partially) non-functional [rt.cpan.org #70890] #2

@toddr

Description

@toddr

Migrated from rt.cpan.org#70890 (status was 'new')

Requestors:

From pjotrekse@gmail.com on 2011-09-12 10:59:56
:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions