Re: windows one liner to output unix line feed
- From: Christian Winter <thepoet_nospam@xxxxxxxx>
- Date: Sun, 23 Aug 2009 08:54:40 +0200
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
.
- Follow-Ups:
- References:
- windows one liner to output unix line feed
- From: boman
- Re: windows one liner to output unix line feed
- From: Glenn Jackman
- Re: windows one liner to output unix line feed
- From: David Harmon
- Re: windows one liner to output unix line feed
- From: Brian Wakem
- Re: windows one liner to output unix line feed
- From: Keith Thompson
- Re: windows one liner to output unix line feed
- From: sln
- windows one liner to output unix line feed
- Prev by Date: Preventing lines from printing
- Next by Date: Re: How to code an implicit $_ argument?
- Previous by thread: Re: windows one liner to output unix line feed
- Next by thread: Re: windows one liner to output unix line feed
- Index(es):
Relevant Pages
|