At 20.44 -0400 1999.04.09, jason white wrote: >basically, I want to turn any new line...(CR for Mac, CRLF for PC, LF for >UNIX/LINUX) and turn it into a <br> tag in my parsing. The simple OK, use what Ronald gave, or what I gave but putting a <BR> before the \n. >s/\n\r/<br>\n/g; > >seems to work. Tried it on both PC and Mac. Don't have a Unix Box to check >it at the moment, but would assume it would work equally as well. No, that won't work, and neither will this: $line =~ s/[\n\r]/<br>\n/g; Which is what I think maybe you were referring to. The problem with simply \n\r is that \n and \r change meanings on the Mac platform, so your ordering is off. [\n\r] can almost work, but if someone has an \r\n (or \n\r) sequence, you get extra newlines, one for each \r, and one for each \n. Further, if you add a + or *, then all consecutive \rs and \ns are swallowed. >I want to venture into the octal/hex world but have only tinkered. It's very simple. \015 is CR. \012 is LF. This is much simpler than using \r and \n, where \n is LF and \r is CR on Unix, but \n is CR and \r is LF on Mac OS. So anyway, use Ronald's or mine with the <BR> inserted, and you should be fine. -- Chris Nandor mailto:pudge@pobox.com http://pudge.net/ %PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6']) ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org