in reply to Net::Server::PreFork requires new line to end input

OK I found the solution. Adding $|=1 did not change anything.
betterworld - you were right half way but that was enough to point me what to do - you mentioned that I used the readline operator (<$sock>) which waits for new line or EOF or error.

Using read should be used in binmode. But I needed a way to know how many bytes I'm about to read so read func will not wait forever for additional input.
I am doing it by packing the length of the string at the begining of the string, and then send it. The receiving side unpack the length of the incoming string, and read func is issued with the specific length of string that is buffered.

So to be pragmatic, in the above code I changed the "$sock->send" (or "print $sock") to the following:
my $str_with_length = pack("N/a*", $some_data); $sock->send($str_with_length);
And instead of reading line by line ("while (<$sock>)") I used the following code:
while (read ($sock, $buf, 4) != 0) {last;}; my $length = unpack("N", $buf); read ($sock, $input_str, $length);
In addition, in both client and server I set to socket to binmode:
binmode $sock;
I was influenced by IO::Socket::SIPC.

To sum it up

This is what those two programs do:
1. Client connect to server
2. Client calculate the length of string, pack it, and send to server
3. Server read the first 4 bytes of the string and unpack the length of the rest of the string
4. Server read the rest of string
5. Server process the string, pack the length into it, and send it back to client
6. Client read the first 4 bytes of the string and unpack the length of the rest of the string
7. Server read the rest of string

So, thank you for you help, and hopefully this code will help someone in the future.