while (1) { print "You are in room", $player->getCurrentRoom->getName; print "There are several items in this room:", map {$_->getName}, $player->getCurrentRoom->getItems; print "In the north, there is ", $player->getCurrentRoom->getNorthRoom->getName; ... print "Choose: move (N),(S),(W),(E); (T)ake, (L)ook, (I)nventory, (Q)uit"; my $action = read_action; if ($action =~ /[NSWE]/) { $player->move($action) or print "Couldn't move to $action"; } elsif ($action =~ /[TL]/) { my $item = read_item; if ($action eq 'T') { $player->take($item) or print "Couldn't take $item"; } else { print $player->getCurrentRoom->getItem($item)->getDescription || "No description available"; } } }