Hmm, binmode should not be needed on Linux (or Unix.) From perldoc -f binmode:
in reply to Re^2: Help with RC4
in thread Help with RC4
But the libraries on Unix-like systems make no such distinction. I'm guessing that the measures you took worked around the bug I mentioned below.
Arranges for FILEHANDLE to be read or written in "binary"
or "text" mode on systems where the run-time libraries
distinguish between binary and text files..
"Even if you are on the right track, you'll get run over if you just sit there." - Will Rogers