Loading ...
Sorry, an error occurred while loading the content.

Line Break

Expand Messages
  • Eugene Heriniaina
    Hello, I m writing a newspage where people can write, butI cannot have the linebreak even if I do this in the form parsing. $value =~ s/ n/ n/g;
    Message 1 of 2 , May 1 11:31 AM
    • 0 Attachment
      Hello,

      I'm writing a newspage where people can write, butI cannot have the
      linebreak even if I do this in the form parsing.

      $value =~ s/\n/<br>\n/g; #this is the attempt to the break

      I also tried just $value =~ s/\r\n/<br>\n/g; but again the same problem.

      Where is the problem? Is it in the textarea of the submitting page? But it
      is like any other Textarea.

      <TEXTAREA NAME="body" COLS=40 ROWS=16 WRAP="virtual"></TEXTAREA>

      Thanks for any help.
    • Dan Boger
      On Mon, 1 May 2000 21:31:59 +0300 Eugene Heriniaina wrote ... does $value have the whole entry in it? try this: $value =~
      Message 2 of 2 , May 2 9:22 AM
      • 0 Attachment
        On Mon, 1 May 2000 21:31:59 +0300 "Eugene Heriniaina" <eug_hery@...> wrote
        concerning '[PBML] Line Break':
        > Hello,
        >
        > I'm writing a newspage where people can write, butI cannot have the
        > linebreak even if I do this in the form parsing.
        >
        > $value =~ s/\n/<br>\n/g; #this is the attempt to the break
        >
        > I also tried just $value =~ s/\r\n/<br>\n/g; but again the same problem.
        >
        > Where is the problem? Is it in the textarea of the submitting page? But it
        > is like any other Textarea.
        >
        > <TEXTAREA NAME="body" COLS=40 ROWS=16 WRAP="virtual"></TEXTAREA>
        >

        does $value have the whole entry in it? try this:

        $value =~ s/\n/<br>\n/gs;

        from the perlre manpage:

        s Treat string as single line. That is, change "." to
        match any character whatsoever, even a newline, which
        normally it would not match.

        Hope that helps,

        Dan

        Dan Boger - Georgetown Institute for Cognitive and Computational Sciences
        dan@... ICQ: 1130750
        Georgetown University Medical Center Washington, DC
      Your message has been successfully submitted and would be delivered to recipients shortly.