in reply to Reporting entries in a file
If I understand rigth you want to count the number of occurrencies of every distinct "word" in your file.
To do so you should extract the "words" from the file and use a hash (not an array) to count the occurrencies. At the beginning the hash is w empty; for every word you extract, you check if defined($hash{$word}): if it is defined then you increment the value, else you put the value to one.
Careful with that hash Eugene.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reporting entries in a file
by SkullOne (Acolyte) on May 30, 2008 at 22:11 UTC | |
by alexm (Chaplain) on May 30, 2008 at 22:26 UTC | |
by SkullOne (Acolyte) on May 30, 2008 at 22:13 UTC | |
|
Re^2: Reporting entries in a file
by rovf (Priest) on Jun 02, 2008 at 09:00 UTC |