[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Sockets, solved.




For anyone who's interested, my Perl socket problem came from buffered 
output.  You see, any output in Perl is automattically buffered.  It is 
only printed when the buffer is full.  Therefore, you have to unbuffer 
the output to the socket with this:

select(SOCKET);
$| = 1;
select(STDOUT);

select the socket (before anything is printed to it) and set $| = 1.  
If $| is a non-zero, it shuts off buffering for that filehandle.

Also, a CRLF is needed at the end of each command sent to the server.  
This is represented as \015\012 (cool...that's a carrige return and a 
linefeed in ascii numbers).

Thanks to Paul J. Schinder at NASA Goddard Space Flight Center for this 
information.

Sincrely,
Anthony Eden
Hurricane Online Editor
http://www.hurricane.miami.edu/