- or download this
package Original;
sub new {
...
my $self = shift;
return $self->new($self);
}
- or download this
sub new {
my $class = shift;
my $self = _init(@_); # private method
...
my $self = shift;
return $self->new($self); # pass this as a hash ref
}
- or download this
sub copy {
my $self = shift;
my $new = __SUPER__->init($self->new($self));
return $new;
}