my ($class, $args) = @_;
my $self = $class->SUPER::new( { color => $args->{color} || 'black' } );
$self->{length} = $args->{length} || 1;
$self->{width} = $args->{width} || 1;
return bless $self, $class;
} my ($class, $args) = @_;
my $self = $class->SUPER::new( {color => $args->{color} || 'black' } );
$self->{diameter} = $args->{diameter} || 1;
return bless $self, $class;
}
I can't understand they insist we are modern language than perl without such features. :)