sub string_of { my $self = shift; return "$self->{color} $self->{name}"; } sub print { my $self = shift; printf "I am a %s \n", $self->string_of; }