The text processing program from Beginning Ruby Chapter 4