develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24312] \x0a reads as "\r\n" on activestate perl (not on cygwin )

Thread Previous | Thread Next
Nick Ing-Simmons
October 28, 2003 00:32
Re: [perl #24312] \x0a reads as "\r\n" on activestate perl (not on cygwin )
Message ID:
Edward Peschko <> writes:
># New Ticket Created by  Edward Peschko 
># Please include the string:  [perl #24312]
># in the subject line of all future correspondence about this issue. 
># <URL: >
>This is a bug report for perl from,
>generated with the help of perlbug 1.34 running under perl v5.8.0.
>[Please enter your report here]
>the following script:
>open(FD, "> filename");
>print FD "\x0a";
>makes 'filename' have a standard, dos, "\r\n" line, not "\n" as expected.

Sorry - you might expect that, but Win32 users expect "\n" to become "\xd\xa"
(CRLF) when writing disk files. i.e. Win32 defaults to textmode.
This is the way Win32 perl is. You need to add 
before the print to turn this behaviour off.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About