First, use strict and warnings. Second, since you don't actually declare any of your variables, I can't tell what scope they're in. Are %wordHash and @wordArray supposed to be scoped within the outter while loop (i.e., reset with each line from DATA), or do they store data for the whole input file?
Where does $i get set? It looks like each time you iterate through %wordHash with while ( ($punctuation, $count) = each(%wordHash) ) the array grows.
More importantly, do you really intend to print the contents of %wordHash after every line read from DATA? Unless the hash is scoped within the outter while loop, you probably want to move the while/print block outside of that loop.
You need to give us more information about what you are trying to do in order for us to be of more help. Please see How (Not) To Ask A Question.
Update: Thank you for adding more information to your original post. It appears several of us were on the right track, but after reading the responses it is clear that there was still quite a bit of confusion. Be as specific as you can when you post - it will allow us to help you more efficiently.
In addition, please read Writeup Formatting Tips and note the section on readmore tags. Including 400 lines of output without them makes the thread a bit harder to read.
In reply to Re: punctuation search... using ascii
by bobf
in thread punctuation search... using ascii
by Yoda_Oz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |