[Israel.pm] newline character as a portability issue

Jason Friedman jason.friedman at weizmann.ac.il
Thu Jul 8 03:51:18 PDT 2004


Perhaps the

IO::nline package on CPAN is what you are looking for:

http://search.cpan.org/~bmorrow/PerlIO-nline-0.03/nline.pm

>From the page:

"This layer translates any of \r, \n or \r\n into \n on input, and into
\r\n on output. It is probably a bad idea to mix it with :crlf on one
filehandle: in particular, under DOSish systems it is definitely a good
idea to push :raw before you start."

It may not handle the more obscure variants mentioned on the list
however . . .

Disclaimer: I never used this package.

Jason

> Bottom line...
> 
> say I have a regex pattern:
> 	/\p{InMyCharacterClass}\n\p{InMyOtherCharacterClass}/
> and I want this to be portable across systems (I have no
> knowledge of the text I'm receiving as input) what should
> stand instead of \n in the pattern?
> 
> How can I make this platform dependent?
> 
> -- 
> Shlomo Yona
> shlomo at cs.haifa.ac.il
> http://cs.haifa.ac.il/~shlomo/
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
> 

--
Jason Friedman
Ph.D. Student
Department of Computer Science and Applied Mathematics
Weizmann Institute of Science, Rehovot, Israel.
Home page: http://www.wisdom.weizmann.ac.il/~jason





More information about the Perl mailing list