in reply to Password with hashes

Use exists to determine whether there is a key in the hash:
exists $pword{$username} || $pword{$username}=&ask_the_user();
Sorry if my advice was wrong.