sub role_play_game { print "What is the Name of the character you wish to play as? "; chomp ( $name = ); print "What is the gender of your character? m/f: "; chomp ( $gender = ); print "What is the Age of the character? (years): "; chomp ( $age = ); print "\n"; $player = new Player ($name, $gender, $age); $player->getValues; $player->start; $player->invent; } package Player; sub new { my $class = shift; my $self = { name => shift, gender => shift, age => shift, level => 1, hp => 10, currhp => 10, }; $inv = { q_itm => "no", money => 0, }; # Print all the values just for clarification. bless ($self, $class); bless ($inv); return $self; } sub getValues { my $self = shift; print "\nName is $self->{name}\n"; print "Gender is $self->{gender}\n"; print "Age is $self->{age}\n"; } sub start { my $self = shift; print "You are Level $self->{level}\n"; print "You have $self->{currhp} of $self->{hp} hit points left!\n"; } sub invent { #This is where it gets a little... dirty. print "You have $inv->{q_itm} quest items!\n"; print "You have $inv->{money} gold!\n"; } 1;