in reply to Re: catching \n
in thread catching \n

Or, if you want to be really portable, you could use s/\r?\n|\n?\r//g. That should catch most every platform's newline style, IIRC.

bbfu
Black flowers blossom
Fearless on my breath

Replies are listed 'Best First'.
Re^3: catching \n (standards)
by tye (Sage) on Aug 07, 2003 at 15:49 UTC

    If the web client (browser) doesn't use ASCII "\r\n"1 for newline in the text it sends to you, then the web client is broken, IMHO.

    1Note that this is not ambiguous. I know that "\r\n" on old Macs results in ASCII "\n\r", but that is because those Macs are near-ASCII systems despite them claiming to be ASCII systems. q-:

                    - tye