SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Nov 2002
    0 Post(s)
    0 Thread(s)

    perl form handling - carriage returns

    I have a simple textbox in an html form. I enter in some data on different lines in the textbox by hitting enter to go to the next line. When I display the string (either on the following webpage or writing to an external file), there are no carriage returns, only spaces. How do I create these carriage returns on the webpage or in the external text file? Thanks for checking this out...
    - Jesse

  2. #2
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Atlanta, GA, USA
    0 Post(s)
    0 Thread(s)
    I'm guessing that the line breaks are being preserved but they need to be converted from \n or \r to <br> in order for them to show up in a browser.

    Is that it? If so, I'm sure there is a package that can take care of it, or you can use some regex, something like this perhaps:
    or maybe this:

    Post back if this helps or not... I haven't been working with Perl much lately so it has been fading from my memory which is a shame since it is so handy.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts