package Mammal;

sub new {
       my $type = shift;
       my %params = @_;
       my $self = {};
       $self->{'Name'} = $params{'Name'};
       $self->{'Sex'}  = $params{'Sex'};
       $self->{'Weight'}  = $params{'Weight'};
       $self->{'Color'}  = $params{'Color'};
       bless $self, $type;
}

package Cat;

@ISA = qw( Mammal );

sub new {
       my $type = shift;
       my %params = @_;
       my $self = Mammal->new(@_);
       $self->{'Character'}  = $params{'Character'};
       bless $self, $type;
}

# method の書き方

  sub miyao {   my ($self,$arg) = @_;    $self->{Name} = $arg; }

  sub name_print {   my ($self) = @_;    print $self->{Name}; print "\n";}

# 使い方

 $a = Cat->new(Name=> Jackey, Sex=>F);
 print $a->{Name};print "\n";
 $a->name_print;

