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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

will strip out all carriage return linefeed characters.

hope this helps
  tobias
0
amitpagarwalCommented:

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

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

-thanks
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.