in reply to punctuation search... using ascii

At first reading, the reason is because you're using one global hash %wordHash whereas what you actually want to do is use a fresh hash for each line you read in the input. At least, I think so. If I'm right then the solution is to put the line

my %wordHash;
right inside your outer while loop. I also doubt that your inner loop does what you really want it to, but I'm not sure.

Which brings me to my main point. I'm sorry to be blunt, but this needs to be said. When you are asking for help on an Internet forum, a terrible way to go about it is to say "you can kinda guess what im trying to do." Instead, say what you're trying to do clearly and concisely, then show the code. When you do that, your friendly readers may notice something about your code that's not going to work, based on your stated purpose. But without that stated purpose, we have no idea whether the code is "working" or not. So please help us out.

Update: One other thing. The way you're adding elements to the array, using $i, will work but I strongly encourage you to use push instead because it's clearer and less likely to have errors.