Date: Saturday March 8, 2003 6:12 p.m. From: Mark Jacobson To: 810-151-02@uni.edu Subject: Assignment #2 - Counting words in an input file... Due on Friday, March 14th. Turn in 1. A printout of the PERL program. 2. A printout of the sample file used for input. 3. A printout of the output of your program as run on that input file. The study guide questions will not be collected next Friday. They are just study questions to use in preparing for the final exam. If you don't use them, you will probably not do as well on the final exam. The assignment that is due on Friday will be the one to use a hash to count the words in a file. 1. your word count should ignore the case of the words, and 2. you printout of the words and the counts should print out the words: a. in all lowercase letters, b. sorted into ascending alphabetical order, c. with the output being broken down like a dictionary, with a couple blank lines separating the a's from the b's, or whatever the next letter was. presumably, all of the letters of the alphabet won't be represented in a small input data file. d. with the output having 4 or 5 words and word counts per line, instead of just one word/count pair per line. Example output: a 123 acute 4 amaze 14 amazing 349 art 12 artist 5 astute 27 attack 2 attic 1 attract 3 attrition 2 bake 4 baking 2 bask 2 bait 8 beam 16 bilbo 5 bright 10 broken 31 brood 9 broom 1 cake 12 candle 5 cool 21 courtesy 18 critical 19 crumb 7 crust 91 fake 9 fly 2 fool 1 fumble 12 futile 3 happy 8 help 10 helpful 7 jazz 1 june 24 music 22 musical 18 musician 12 oblivious 9 obvious 2 wes 3 western 12 wool 4 work 5 woven 2 ----------------------------------------------------------------------- Here is how I planned the output. It is predicted there will be no words with a length longer than 17 characters in length, and that any word with a length of 17 would have a count of 9 or less. 1 2 3 4 5 6 7 1234567890123456789012345678901234567890123456789012345678901234567890123456 a 123 acute 4 amaze 14 amazing 349 ... wes 3 western 12 wool 4 work 5 woven 2 Mark