transmission_err has asked for the wisdom of the Perl Monks concerning the following question:

i need to take the text from the box and write it to a document, but i dont want it to print any returns. i tried $INPUT{'post'} =~s/\n//g; ,but that only worked half the time.
  • Comment on removing returns from a submited text box

Replies are listed 'Best First'.
Re: removing returns from a submited text box
by CharlesClarkson (Curate) on Nov 23, 2001 at 18:40 UTC

    s|\n||gm; will rid you of all newlines (\n) by treating the string as multiple lines. It will also eliminate white space between words. s|\n| |gm; will replace newlines with a space. </CODE>

Re: removing returns from a submited text box
by TomK32 (Monk) on Nov 23, 2001 at 10:54 UTC
    I've tried it myself and had no problem, but maybe you should try s/\n//gm or put the \n into ()'s at best post the strings that troule you