in reply to DOS characters

If $text_area =~ s/\n//g; is working for you now, other than the ^M issue, try:
$text_area =~ s/[\r\n]+//g;
Though, I would think you'd want to replace EOL chars with a space, otherwise the first word on one line will get glued onto the last word in the previous line. I'd suggest:
$text_area =~ s/[\r\n]+/ /g;
instead to avoid this situation.

-Blake

Replies are listed 'Best First'.
Re: Re: DOS characters
by kjherron (Pilgrim) on Sep 06, 2001 at 03:56 UTC
    Transliteration would be more efficient than a regexp for this kind of operation:
    $text_area =~ tr/\r\n/ /s;
    This removes any sequence of carriage returns or newlines, replacing them with a single space.