[Israel.pm] newline character as a portability issue

Dovalle Yankelovich dovalle at smlink.com
Wed Jul 7 23:44:49 PDT 2004

Another solution, which will work only if you first read a file with
return new line on a machine and manipulate it to work on same machine,
$file =~ s(\015\012?|\012){\n}g;


-----Original Message-----
From: Shlomo Yona [mailto:shlomo at cs.haifa.ac.il] 
Sent: Thursday, July 08, 2004 06:50
To: Perl in Israel
Subject: RE: [Israel.pm] newline character as a portability issue

On Thu, 8 Jul 2004, Dovalle Yankelovich wrote:

> I think the ASCII codes 13, 10 (carriage return and new line
> respectively) should be 'cross platform', so instead using shorts
> as '\n') add these 2 chars to your output.

This probably isn't exactly accurate.
perldoc perlport also mentions \015 and \012...

So -- apparently, this is indeed something which requires
some general handling rather than simply betting on the
correct character...

Shlomo Yona
shlomo at cs.haifa.ac.il
Perl mailing list
Perl at perl.org.il

More information about the Perl mailing list