in reply to how to escape eof - chr(26)?
since you mentioned Win32: try binmode on your filehandle.. it will get it right