[Israel.pm] newline character as a portability issue

Dovalle Yankelovich dovalle at smlink.com
Wed Jul 7 22:14:29 PDT 2004

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


-----Original Message-----
From: Shlomo Yona [mailto:shlomo at cs.haifa.ac.il] 
Sent: Wednesday, July 07, 2004 18:27
To: perl at perl.org.il
Subject: [Israel.pm] newline character as a portability issue


I have a script which does some manipulation to texts.
This script assumes that '\n' is the newline character.

I wonder how I can make the script more robust across
platforms, regarding newline characters.

I know that on unices that '\n' is the newline. I don't
really know if that is always the case, and I also don't
know what happens on other platforms.

What would be a good way to attack this issue?
Once I have a solution, what would be the way to write tests
(using Test::More) to ensure that during installation (say,
during 'make test')? I mean, how can I make a platform
dependent test for this issue?


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

More information about the Perl mailing list