Re: help slurping a file-- Solved -- Thanks for responses



On Oct 28, 2005, at 15:09, Jeff 'japhy' Pinyan wrote:

On Oct 28, Renee Halbrook said:


My perl interpreter display does not recognize "\r" for a newline character
for standard out, so it simply printed the same line over on top of the
previous line, making it look like it was only reading one line total.
The slurping was working fine, but the display was not what I anticipating.



That's not Perl's issue. That's your terminal's issue. And it's not an "issue", because that's what \r is supposed to do. \r is a carriage return, which only means the cursor is brought back to the beginning of the line.


(Except maybe on Macs, I don't know. That's weird. I don't use a Mac, though, so I can't be sure.)

In Mac OS X the newline is \012 and that is what "\n" is eq to. I was told in MacPerl (for MacOS pre X) the underlying codes of \n and \r were switched (wrt to the rest of platforms), but still \n is the logical newline everywhere.


-- fxn


.



Relevant Pages

  • Re: The tellg bug
    ... > reading pointer when reading UNIX files ... > CRLF as a single character. ... The standard specfies that if you open a file in text mode then only four ... get the bit about 'accidentally converted to UNIX LF-format'. ...
    (comp.lang.cpp)
  • Re: help slurping a file-- Solved -- Thanks for responses
    ... for standard out, so it simply printed the same line over on top of the previous line, making it look like it was only reading one line total. ... (Except maybe on Macs, I don't know. ... RPI Acacia Brother #734 % the cheated, we who for every service http://www.perlmonks.org/ % have long ago been overpaid? ...
    (perl.beginners)
  • Re: iswspace and iswprint
    ... My reading says not, but then I have an out of date copy of ... >> the standard and it seems rather as basic mistake for Microsoft to have ... > the multibyte character resulting from wctomb with the wide character. ...
    (comp.lang.c)
  • Re: what is ^M at the end of a line?
    ... i've tried "chomp" when reading each line but it doesn't work... ... That's "\r" everywhere except in Macs before Mac OS X. ... just one character. ...
    (perl.beginners)
  • Re: Fastest PC - a Mac Pro
    ... I have used two button mice with Macs for many, ... there is an advantage to the one button standard - it ... "figuring out that the one button mice were bullshit". ... And the one button standard on Macs has never been "bullshit", ...
    (comp.sys.mac.advocacy)