#This is the detail of the class: package Cell; sub new{ my $class = shift; my $self = { content => -1, }; return bless $self, $class; } #This is my setter and getter sub setContent{ my ($self,$ch) = @_; $self->{content} = $ch; print("stored char".$self->{content}."\n"); } sub getContent{ my $self = @_; print("passing back char".$self->{content}."\n"); return $self->{content}; } # this is the way i used the class my $ch = "a"; my $cell = Cell->new(); $cell->setContent($ch); my $testvar = $cell->getContent(); print("test start\n".$testvar); print("test end\n"); #