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"; %new_hash; $new_hash{$username} = $password; print "To search for a user please type in the last name, firstname and hit enter.\n"; while() { chomp; if (exists $new_hash{$_}){ print "The username is $username and the password is $password, please enter another name to search for.\n"; } else { print "I'm sorry, there is no one here by that name please try again.\n"; } }