#Before writting on the socket $sock->autoflush(); # so output gets there right away #### #when writting $data to the socket print $sock $data . "\015\012"; #### #when done writting to the socket close($sock);