I have written a socket connected - works fine. connects.

I am trying to pull in multiple characters (like a username) but the code just lets me type 1 character at a time. Any info or links are appreciated.

Relevant Code attached.

    # waiting for a new client connection
    my $client_socket = $socket->accept();
    my $response = "";
    # get information about a newly connected client
    my $client_address = $client_socket->peerhost();
    my $client_port = $client_socket->peerport();
    print "connection from $client_address:$client_port\n";
    #send connect banner
    #$response = $client_socket->recv($response, 2);
    if ($response == 1) {
     #$client_socket->send("ANSI Selected" . $reset);

    if ($response == 2) {

     $client_socket->recv($response, 1024);

    $client_socket->recv($response, 1024);
client_socket->recv will only receive one character at a time.. then goes to next prompt.