Perl's identifiers are case sensitive. %userHash is not the same as %userhash.

One of the first things I do in such situations is a global case-insensitive search for the identifier using my editor. As I iterate through the search results it's much easier for my eyes to spot when something changes than by just skimming through the code.

One thing that might have made it easier to spot would be following Schwern's Skimmable Code talk's advice. Moving some of the complexity in your while/if constructs into subroutines would move the usage of %userhash visually closer to its declaration, which might be a good thing.

When putting a smiley right before a closing parenthesis, do you:

Use two parentheses: (Like this: :) )
Use one parenthesis: (Like this: :)
Reverse direction of the smiley: (Like this: (: )
Use angle/square brackets instead of parentheses
Use C-style commenting to set the smiley off from the closing parenthesis
Make the smiley a dunce: (:>
I disapprove of emoticons
Other