[Chapter 5] 5.6 Exercises
Author: Randal Schwartz, Tom Christiansen & Larry Wall
Date: 1999-07-02T01:32:42Z

#

| Chapter 5 Hashes |

## 5.6 Exercises

See Appendix A, Exercise Answers for answers.

1. Write a program that reads in a string, then prints that string and its mapped value according to the mapping presented in the following table:

   Input | Output
   --- | ---
   red | apple
   green | leaves
   blue | ocean

2. Write a program that reads a series of words with one word per line until end-of-file, then prints a summary of how many times each word was seen. (For extra challenge, sort the words in ascending ASCII order in the output.)

5.5 Hash Slices |  | 6. Basic I/O