-----test.pl------- use Cat; $mycat = cat->new(); $mycat->feed("fish"); exit; -----Cat.pm------- package Cat; use strict; use warnings; our $VERSION = '0.01'; our @ISA = (); sub new { my $class = shift; my $self = { Stomach => "empty" }; bless $self, $class; return $self; } sub feed { my ( $self, $food ) = @_; $self->{ Stomach } = $food if defined $food; return $food; } 1; __END__