Re: windows one liner to output unix line feed



sln@xxxxxxxxxxxxxxx wrote:
[...]
It really doesen't matter what the :crlf layer does in unix.
It only matters how the console device interprets CR's as a tty.
You can have a thousand CR's and one LF before you print and it will
still print on the next line (Mac may be different).

I think you're mixing up two different things here, one is
text file IO (and the way Perl implements it on different
platforms) and the other is console IO, which would only
apply when piping/directing to or from a perl script.

If his file eol is all CR's ala Mac, then he opened it without an eol
and processed the whole file as one line. Otherwise, a series of
text embedded with just CR's on a console where a CR is a control character,
will result in overwrites of the lines without LF's.

And here you're mixing up Perl's behaviour for input line separators
and output line separators too. Using the "-i" switch, there's no
console involved, Perl simply opens a file and sequencially inserts
what gets passed to print. If the file has been opened with a :crlf
layer, this just means that any newlines encountered in the process
are replaced by a sequence of carriage return plus newline.

What a console shows you when you cat the file contents is a very
different thing.

If I had a unix machine I could try it out. It seems it would be a major
fopah if Perl didn't get the basic unix console correct, lol.

Again, what's that got to do with a console? You're seriously getting
off the track.

-Chris
.



Relevant Pages

  • Re: windows one liner to output unix line feed
    ... It only matters how the console device interprets CR's as a tty. ... apply when piping/directing to or from a perl script. ... text embedded with just CR's on a console where a CR is a control character, ... I know the layers of Perl better than you do by your response. ...
    (comp.lang.perl.misc)
  • Re: windows one liner to output unix line feed
    ... It only matters how the console device interprets CR's as a tty. ... apply when piping/directing to or from a perl script. ... text embedded with just CR's on a console where a CR is a control character, ... I know the layers of Perl better than you do by your response. ...
    (comp.lang.perl.misc)
  • Re: Console output (or anything) on Win32?
    ... WriteConsoleW from perl without wrapping it yourself: ... None of those files have names that require Unicode. ... One of your goals was to get "full Unicode text on the console", ...
    (comp.lang.perl.misc)
  • Re: oslevel output
    ... no indication on the console that the machine's going down, ... I did download perl 5.8.2 from the Linux toolkit and pointed ... If a normal user can trigger panics, this would at least allow DOSes. ... Also, if you are in the mood/position to experiment, I would like to know if the panic can be triggered by a normal user too. ...
    (comp.unix.aix)
  • Re: sleep under windows cmd
    ... But the script ist waiting 2 seconds first and than it ... output to the console is buffered for efficiency. ... The perl idiom for turning of the output buffering to ...
    (perl.beginners)