That way, you can do MI more easily:package Bob; sub new {bless({}, shift)->init} sub init { my $self = shift; $self->{command} = undef; $self; } my $bob = Bob->new;
package MyUncle; sub new {bless({}, shift)->init} sub init { my $self = shift; $self->{topping} = "dessert"; $self; } package BobIsMyUncle; our @ISA = ('Bob', 'MyUncle'); sub new {bless({}, shift)->init}; sub init { my $self = shift; $self->Bob::init->MyUncle::init; $self->{floor}='wax'; $self } my $bob_is_my_uncle = BobIsMyUncle->new;
In reply to Re: new() function: incorrect?
by JavaFan
in thread new() function: incorrect?
by lukeyboy1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |