Re: newlines on win32, old mac, and unix

2006-06-19 Thread Xavier Noria
On Jun 19, 2006, at 22:45, Anthony Ettinger wrote: # order matters $raw_text =~ s/\015\012/\n/g; $raw_text =~ s/\012/\n/g unless "\n" eq "\012"; $raw_text =~ s/\015/\n/g unless "\n" eq "\015"; Does it make any difference if I use s/\cM\cJ/cJ/ vs. s/\015\012/\n/ g ? The regexp i

Re: newlines on win32, old mac, and unix

2006-06-19 Thread John W. Krahn
Anthony Ettinger wrote: > On 6/19/06, John W. Krahn <[EMAIL PROTECTED]> wrote: >> Anthony Ettinger wrote: >> >># order matters >> >>$raw_text =~ s/\015\012/\n/g; >> >>$raw_text =~ s/\012/\n/g unless "\n" eq "\012"; >> >>$raw_text =~ s/\015/\n/g unless "\n" eq "\015"; >> > >> > Does

Re: newlines on win32, old mac, and unix

2006-06-19 Thread Anthony Ettinger
On 6/19/06, John W. Krahn <[EMAIL PROTECTED]> wrote: Anthony Ettinger wrote: >># order matters >>$raw_text =~ s/\015\012/\n/g; >>$raw_text =~ s/\012/\n/g unless "\n" eq "\012"; >>$raw_text =~ s/\015/\n/g unless "\n" eq "\015"; > > Does it make any difference if I use s/\cM\cJ/cJ/

Re: newlines on win32, old mac, and unix

2006-06-19 Thread John W. Krahn
Anthony Ettinger wrote: >># order matters >>$raw_text =~ s/\015\012/\n/g; >>$raw_text =~ s/\012/\n/g unless "\n" eq "\012"; >>$raw_text =~ s/\015/\n/g unless "\n" eq "\015"; > > Does it make any difference if I use s/\cM\cJ/cJ/ vs. s/\015\012/\n/g ? The string "cJ" in your example

Re: newlines on win32, old mac, and unix

2006-06-19 Thread Anthony Ettinger
# order matters $raw_text =~ s/\015\012/\n/g; $raw_text =~ s/\012/\n/g unless "\n" eq "\012"; $raw_text =~ s/\015/\n/g unless "\n" eq "\015"; Does it make any difference if I use s/\cM\cJ/cJ/ vs. s/\015\012/\n/g ? Since the newline convention is not necessarily the one in the r

Re: newlines on win32, old mac, and unix

2006-06-13 Thread Xavier Noria
On Jun 13, 2006, at 20:26, Anthony Ettinger wrote: I have to write a simple function which strips out the various newlines on text files, and replaces them with the standard unix newline \n In Perl "\n" depends on the system, it is eq "\012" everywhere except in MacOS pre-X, where it is "\01

newlines on win32, old mac, and unix

2006-06-13 Thread Anthony Ettinger
I have to write a simple function which strips out the various newlines on text files, and replaces them with the standard unix newline \nafter reading the perlport doc, I'm even more confused now. LF eq \012 eq \x0A eq \cJ eq chr(10) eq ASCII 10 CR eq \015 eq