in reply to adding to hash/writing to file errors

First: use strictures (use strict; use warnings;).

Second: named subs don't belong inside a while loop (replies to Perl scoping not logical...? may help understand why).

When you add use strict; you will find the variable $username can't be found. Because you use it in various subs you need to pass it into those subs. You've done that for greeting, but not elsewhere.


Perl is environmentally friendly - it saves trees