in reply to What is the difference between sending bytes and characters over sockets?

You really need to find out what the difference is between what you sent, and what that person expected to see.

If you are on Windows, you very well may need to use binmode to be sure that your end of line doesn't get translated into 2 characters. You might be sending numbers and they need the output of a pack statement (see also unpack) rather than a text representation of the number. There are stranger possibilities. For instance the program at the other end of the line might be written in C, and might be looking for the end of your string to be a null byte (you write that as "\0"). Or you could unexpectedly be sending data in UTF-8 format and need to turn that off.

The description makes it unclear how to solve the problem. You need to first get more detail about how what you sent doesn't match what is needed, and then figure out how to solve that.

  • Comment on Re: What is the difference between sending bytes and characters over sockets?