Last active
December 21, 2015 01:48
-
-
Save tomcha/6229838 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Neko; | |
sub new{ | |
my $class = shift; | |
my $self = { | |
name => 'none', | |
color => 'none' | |
}; | |
return bless $self,$class; | |
} | |
sub name{ | |
my $self = shift; | |
if(@_){ | |
$self->{name} = shift; | |
} | |
return $self->{name}; | |
} | |
sub color{ | |
my $self = shift; | |
if(@_){ | |
$self->{clolor} = shift; | |
} | |
return $self->{color}; | |
} | |
sub says{ | |
my $self = shift; | |
print 'my name is '.$self->name().".\n"; | |
print 'my color is '.$self->color().".\n\n"; | |
} | |
sub loves{ | |
my $self = shift; | |
print $self->name().' loves azuma(neko)san'."\n"; | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment