in reply to Re: removing carriage returns in text area (cgi)
in thread removing carriage returns in text area (cgi)

Thanks antirice, I missed that \r and \n count as whitespace - darn it!! I understand and have taken on board your other good advice. One question, though - why is $words=~tr/\r\n/,/; preferable to  $words=~s/\r\n/,/g;?

Replies are listed 'Best First'.
Re: Re: Re: removing carriage returns in text area (cgi)
by Anonymous Monk on Jul 13, 2003 at 09:53 UTC
    Because tr/// and s/// do different things. tr/// works on character list, while s/// works on patterns.

    Read Regexp Quote-Like Operators in [perldoc://perlop.