in reply to socket gone crazy
Try to work your network programs so that they will continue to work if the client has the wrong line terminator, but always send "\r\n" as your own line terminator. This is pretty typical of the network ASCII protocols including HTTP.
This means that you probably want to strip any returns with tr/\r//d or such, in both your clients and your servers, before doing any other fussy parsing work (even just reversing the characters in the meat of the string).
You can play with $/ if you want to make chomp() smarter, for example, but it seems more flexible to specifically and explicitly work with newlines handling in your own code.
--
[ e d @ h a l l e y . c c ]
|
|---|