Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-10 Thread Chad A Gard
On Sep 9, 2004, at 11:02 PM, Robert Page IV wrote: I am familiar with br. What is the difference between br and br /? In XHTML, all elements need a close. By doing br /, it will work regardless of whether your DTD is for an HTML variant or XHTML. I didn't know which you were using, so

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-10 Thread Bruce Alderson
Robert Page IV wrote: Considering I am not parsing HTML, I am actually trying to 'generate' the text formatting I want in a HTML page, there is no need for a HTMl parser that I see. There are quite a few modules that do this too, like Markdown, Textism, and some of the wiki-markup tools. I've

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread Randal L. Schwartz
Robert == Robert Page IV [EMAIL PROTECTED] writes: Robert Woops! XMP is deprecated with HTMl 4.01. Robert Sorry for the extra message. XMP has been deprecated for over half the age of the web. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL PROTECTED]

RE: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread John Sharpe
-Original Message- From: Robert Page IV [mailto:[EMAIL PROTECTED] Sent: 09 September 2004 03:19 To: Sean Davis Cc: [EMAIL PROTECTED] Subject: Re: CGI.pm : Handling Carriage Returns from textarea() On Sep 6, 2004, at 8:52 PM, Sean Davis wrote: White space (including carriage returns

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread Gunnar Hjalmarsson
Robert Page IV wrote: Sean Davis wrote: White space (including carriage returns) is ignored by HTML, generally. Try surrounding your text output by the pre tag (preformatted text). I added pre('executive summary') and pre('details') to the save_weekly() subroutine and this worked! Thank you very

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread Robert Page IV
Gunnar: Thanks. I read this before in Lincoln Stein's CGI book but it did not register the first time. Thanks for the help as this solves my current issues. Robert Page On Sep 9, 2004, at 5:31 AM, Gunnar Hjalmarsson wrote: Robert Page IV wrote: Sean Davis wrote: White space (including carriage

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread Chris Devers
On Thu, 9 Sep 2004, Chad A Gard wrote: Try this: $details = param('details'); $details =~ s/\r/br //g; Careful now... $ perl -e '$details = foo; $details =~ s/\r/br //g;' Search pattern not terminated at -e line 1. $ The '/' in 'br /' needs to be escaped, or the regex is unbalanced.

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread Chad A Gard
On Sep 9, 2004, at 9:57 AM, Chris Devers wrote: This is why I like to use something other than a slash when trying to match html or xml: $details =~ s#\r#br /#g; Also, did you really mean to replace '\r' with 'br /' ? That will, depending on the file encoding, either [a] do nothing, or [b]

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread Gunnar Hjalmarsson
Chris Devers wrote: I suspect you probably didn't mean to do either of these, but rather: $details =~ s#\n#br /\n#g; Which should portably add a break tag to the end of each source line. HTML parsing is a real bear to get right. For a limited problem like this, mucking around with regular

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread Chris Devers
On Thu, 9 Sep 2004, Gunnar Hjalmarsson wrote: I can't see what this has to do with HTML parsing. The immediate problem has nothing to do with parsing, but it seemed like some of the suggestions given were starting to go in that direction. Unless I was just misreading things... -- Chris Devers --

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread Gunnar Hjalmarsson
Chris Devers wrote: On Thu, 9 Sep 2004, Gunnar Hjalmarsson wrote: I can't see what this has to do with HTML parsing. The immediate problem has nothing to do with parsing, but it seemed like some of the suggestions given were starting to go in that direction. Maybe. The reason for my remark is that

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread Robert Page IV
Considering I am not parsing HTML, I am actually trying to 'generate' the text formatting I want in a HTML page, there is no need for a HTMl parser that I see. Robert On Sep 9, 2004, at 7:30 PM, Gunnar Hjalmarsson wrote: Chris Devers wrote: On Thu, 9 Sep 2004, Gunnar Hjalmarsson wrote: I can't

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread Robert Page IV
I am familiar with br. What is the difference between br and br /? Robert Page On Sep 9, 2004, at 9:36 AM, Chad A Gard wrote: On Sep 8, 2004, at 9:40 PM, Robert Page IV wrote: Gunnar: I have attached the CGI script: weekly.pl. The subroutine save_weekly() captures the 'executive summary' and

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-09 Thread Chris Devers
On Thu, 9 Sep 2004, Robert Page IV wrote: I am familiar with br. What is the difference between br and br /? It's an XHTML / XML -ism. In strict XML markup -- of which XHTML is one example -- all tags have to be balanced. For HTML, this means that tags that it used to be okay to leave unbalanced

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-08 Thread Robert Page IV
On Sep 6, 2004, at 8:52 PM, Sean Davis wrote: White space (including carriage returns) is ignored by HTML, generally. Try surrounding your text output by the pre tag (preformatted text). Does this do what you want? Do I do this within the textarea() form? This does not seem practical if

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-08 Thread Robert Page IV
Gunnar: I have attached the CGI script: weekly.pl. The subroutine save_weekly() captures the 'executive summary' and 'details' values entered into the textarea via $summary = param('executive summary') and $details = param('details'). For Debug purposes, I print $summary and $detail. I may make

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-08 Thread Robert Page IV
Sean: I added pre('executive summary') and pre('details') to the save_weekly() subroutine and this worked! Thank you very much. I am weary about the fact that HTML tags are permitted inside PRE. Apparently, , and must either not be present or handled somehow according to

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-08 Thread Robert Page IV
I found a solution to PRE. It is XMP.. From http://www.frc.ri.cmu.edu/~mcm/tags.html, XMP ... /XMP Like PRE but HTML tags aren't interpreted (except for /XMP) Robert Page On Sep 8, 2004, at 10:21 PM, Robert Page IV wrote: Sean: I added pre('executive summary') and pre('details') to the

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-06 Thread Sean Davis
White space (including carriage returns) is ignored by HTML, generally. Try surrounding your text output by the pre tag (preformatted text). Does this do what you want? Sean On 9/6/04 20:10, Robert Page IV [EMAIL PROTECTED] wrote: I am trying to write a simple weekly entry CGI script and I

Re: CGI.pm : Handling Carriage Returns from textarea()

2004-09-06 Thread Gunnar Hjalmarsson
Robert Page IV wrote: I am trying to write a simple weekly entry CGI script and I am trying to capture a the string returned from a textarea, assign the value to either a variable or array and output it to a web page with print or printf or sprintf/print. When I do this, apparently carriage

RE: CGI.pm : Handling Carriage Returns from textarea()

2004-09-06 Thread Charles K. Clarkson
Robert Page IV [EMAIL PROTECTED] wrote: : I am trying to write a simple weekly entry CGI script : and I am trying to capture a the string returned from : a textarea, assign the value to either a variable or : array and output it to a web page with print or printf : or sprintf/print. : : When I