open (FH,'>',"linefeed.txt"); # binmode FH; # I have added this line print FH "This is a line\r\n" __END__ This is a line^M (viewed under gvim on win XP SP 2)