to delete the trailing newline
I have a variable and I want to write it into a textarea (HTML). The problem is when I look at the textarea in my HTML page, there is the text I want, plus a trailing newline. How can I delete this. My variable: $texte=wazaa; In textarea: wazza tks Sorry for my english steph
Re: to delete the trailing newline
On Wed, 27 Jun 2001, Stéphane JEAN BAPTISTE wrote: I have a variable and I want to write it into a textarea (HTML). The problem is when I look at the textarea in my HTML page, there is the text I want, plus a trailing newline. How can I delete this. My variable: $texte=wazaa; In textarea: wazza You can chomp off that trailing newline using 'chomp'. Weren't you the guy who was asking about it yesterday? -- Brett http://www.chapelperilous.net/btfwk/ This fortune intentionally says nothing.
Re: to delete the trailing newline
you might want to try to use 'chomp' on your variable... this function is specifically there to 'chomp off' trailing newlines you'll often see it used as: open FH, 'foo.txt'; while(FH){ chomp; #remove trailing newline do something } perldoc -f chomp for details hth, Jos Boumans Stéphane JEAN BAPTISTE wrote: I have a variable and I want to write it into a textarea (HTML). The problem is when I look at the textarea in my HTML page, there is the text I want, plus a trailing newline. How can I delete this. My variable: $texte=wazaa; In textarea: wazza tks Sorry for my english steph
Re: to delete the trailing newline
Brett W. McCoy a écrit : On Wed, 27 Jun 2001, Stéphane JEAN BAPTISTE wrote: I have a variable and I want to write it into a textarea (HTML). The problem is when I look at the textarea in my HTML page, there is the text I want, plus a trailing newline. How can I delete this. My variable: $texte=wazaa; In textarea: wazza You can chomp off that trailing newline using 'chomp'. Weren't you the guy who was asking about it yesterday? Yes! But chomp delete it in perl but not the conversion in HTML.
Re: to delete the trailing newline
On Wed, 27 Jun 2001, Stéphane JEAN BAPTISTE wrote: You can chomp off that trailing newline using 'chomp'. Weren't you the guy who was asking about it yesterday? Yes! But chomp delete it in perl but not the conversion in HTML. Oh, I'm sorry! Perhaps you have a newline embedded in your script, like this: textarea$variable /textarea -- Brett http://www.chapelperilous.net/btfwk/ It'll be just like Beggars' Canyon back home. -- Luke Skywalker