in reply to Re: long text message problem
in thread long text message problem

Don't use \r in portable applications, especially in use for communication with other systems. \r is LF (\x0A) on the Mac, and CR (\x0D) on other ASCII platforms. \x0D is always CR.

Replies are listed 'Best First'.
Re^3: long text message problem
by graff (Chancellor) on Mar 11, 2006 at 16:14 UTC
    \r is LF (\x0A) on the Mac, ...
    Huh? Where does this assertion come from, and how exactly would it apply to macosx? Could it be obsolete residue from the bad old os9/mac-perl days? It doesn't seem to hold true on the macosx(10.4.5) that I'm using at the moment:
    $ perl -e 'print "\r"' | od -t xC -a 0000000 0d + cr
    update: Just to make sure there wasn't some asymmetry:
    $ perl -e 'print "\r"' | perl -e '$_=<>; print "got CR\n" if (/\r/)' | + od -t xC -a 0000000 67 6f 74 20 43 52 0a g o t sp C R nl
    (this is perl 5.8.6, btw; presumably, running the latter script on a windows box would yield 8 bytes of output)