I seem to remember using binmode on the filehandles
in a situation like yours; that may do what you want without your having to do any line
ending translation explicitly. That only is important on
non-Unix systems as I recall.
Comment on Re: Conversion of unix LF to DOS LF issues