in reply to auto add a carriage return in front of a line feed, how to delete this auto character.

I gather you are running ActiveState perl on a Windows box. A PerlIO layer is responsible for converting the newline into a cr-lf sequence. As others have suggested, you can read up on I/O layers via perldoc perlio.

To solve your problem, try one of these:

binmode STDOUT, ":unix"; binmode STDOUT, ":raw";
To see what I/O layers are active for STDOUT, use:
print "@{[PerlIO::get_layers(STDOUT)]}\n";
My ActiveState Win32 perl reports the layers unix crlf for STDOUT. On the same box, however, Cygwin perl reports the single layer stdio.
  • Comment on Re: auto add a carriage return in front of a line feed, how to delete this auto character.
  • Select or Download Code