[Israel.pm] newline character as a portability issue

Shlomo Yona shlomo at cs.haifa.ac.il
Wed Jul 7 09:27:26 PDT 2004


Hello,

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?

Thanks.

-- 
Shlomo Yona
shlomo at cs.haifa.ac.il
http://cs.haifa.ac.il/~shlomo/



More information about the Perl mailing list