Removing carriage returns from a string

I am currently using CGI-LIB.pl in my Perl CGI programs.  When I retrieve values from a multi line text area it is possible that the value returned could have carriage returns in it.  Is there anyway to examine this value and remove all carriage returns that are embedded in it ?

I would be grateful for all help offered regarding this.

Thanks in advance

John
johnclarkeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
amitpagarwalConnect With a Mentor Commented:

if $text has the text stored, you can simply say

$text =~ s/[\n\r]//g

-thanks
0
 
thoellriCommented:
$field =~ s/[\n\r]//g;

will strip out all carriage return linefeed characters.

hope this helps
  tobias
0
 
thoellriCommented:
And that adds what substantial piece of information to my post?
0
 
ozoCommented:
or you might want to say something like
s/\s/ /g
0
All Courses

From novice to tech pro — start learning today.