use Data::Dumper; my %passwords; # please don't name your data structure # %new_hash. That's not a telling name at # all while(1) { print "Please enter your first name\n"; chomp ($fname =); { last; } print "Please enter your last name\n"; chomp ($lname =); { last; } print "Please enter a password\n"; chomp ($password =); { last; } print "Please enter 'done' or hit your return key\n"; chomp ($ending =); if ($ending eq '\n' or 'done') { last; } } my $username = "$lname, $fname"; # here comes the magic: print Dumper \%passwords; # you'll see that the hash # is empty. # rest of the script goes here