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
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.my %wordHash;
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.
In reply to Re: punctuation search... using ascii
by Errto
in thread punctuation search... using ascii
by Yoda_Oz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |