in reply to Socket: I don't get what is sent

Looks like a buffer problem. Try setting this, both in client and server:

$| = 1;   # autoflush