If this is a text file, you shouldn't be using
binmode, it's for binary files only. What I guess is happening is that the "client" and "server" are different architectures with differeing ideas of line endings. With
binmode no line-ending translation is done. Without
binmode, line-endings are translated to the native line-ending of the receiving end.