Re: Regex problem
Hi, Here is a code that does what you want and it works if the name has more than 2 names. I've tried an example with a First name, a last name and a middle name but it works for more names also. my $name = "Sarah Mohrley Washington"; my @initials = map /^(\w)/, split /\s+/, $name; print "@initials"; The result is: S M W You have those initials in an array and you can use them more simple, do something with each one and the code is very short. Teddy, Teddy's Center: http://teddy.fcc.ro/ Email: [EMAIL PROTECTED] - Original Message - From: "Sara" <[EMAIL PROTECTED]> To: "org" <[EMAIL PROTECTED]> Sent: Monday, July 21, 2003 2:37 AM Subject: Regex problem $name = "SARA DEILEY"; how its possible to grasp only initials for First and Last name i.e $name ="SD"?? thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Clearing a Form
I have a cgi that creates a form and then receives the output of the form and sends it to a mysql database. It also displays the form information as a preview of what is getting sent to the database. You can return to the original form with data if you need to correct something via an 'Edit' button. This button also makes sure that nothing gets stored in the database (by deleting the data that was just sent and I know there must be a better way to do that part but it's not my current question). If the visitor uses the browser 'Back' button to return to the form, their data will be there but the record won't get deleted from the database. How do I erase all the data from the form if the visitor chooses to use the Back button? I tried the CGI.pm method mentioned in O'Reilly's CGI Programming: print $dataIn->header( -type => "text/html", -expires => "now"); but that doesn't do it. I'm wondering if javascript is the answer? Thanks. -- Peter Fleck Webmaster | University of Minnesota Cancer Center Dinnaken Office Bldg. 925 Delaware St. SE Minneapolis, MN 55414 612-625-8668 | [EMAIL PROTECTED] | www.cancer.umn.edu Campus Mail: MMC 806 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Clearing a Form
> I'm wondering if javascript is the answer? It's going to have to be. Saving those types of things are a function of the browser. Dennis -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Clearing a Form
On Mon, 21 Jul 2003 17:05:57 -0500, Peter Fleck <[EMAIL PROTECTED]> wrote: > I have a cgi that creates a form and then receives the output of the > form and sends it to a mysql database. It also displays the form > information as a preview of what is getting sent to the database. > > You can return to the original form with data if you need to correct > something via an 'Edit' button. This button also makes sure that > nothing gets stored in the database (by deleting the data that was > just sent and I know there must be a better way to do that part but > it's not my current question). > > If the visitor uses the browser 'Back' button to return to the form, > their data will be there but the record won't get deleted from the > database. > > How do I erase all the data from the form if the visitor chooses to > use the Back button? I tried the CGI.pm method mentioned in > O'Reilly's CGI Programming: > > print $dataIn->header( -type => "text/html", -expires => "now"); > > but that doesn't do it. > > I'm wondering if javascript is the answer? > I think the difficulty you are experiencing in your implementation is a direct result and indicator of a design that needs to be re-examined. You are running into the standard problem with a protocol that is stateless (aka HTTP). Rather than switching to use Javascript to handle the "abnormal" use of the browser's back button, you would be better off assuming that 50% of the time that is how a person is going to navigate and do something like store the values as hidden fields in a form on the preview page, then when they use the back button make some edits and resubmit, your script need only re-display the preview page, which makes the implementation easier. Then the data is *only* stored to the DB once the final version is submitted from the preview page. To implement your "edit" feature you need only return them to the original form and pre-fill the fields based on the values submitted in your preview form (which is also your "Edit" form). Sorry if this is confusing, I would re-examine why and when you store data to the DB in your design rather than the implementation details. http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Clearing a Form
You need to set not only the "Expires" HTTP header, but the "Cache-control=no-cache" and Pragma=no-cache" also. Teddy, Teddy's Center: http://teddy.fcc.ro/ Email: [EMAIL PROTECTED] - Original Message - From: "Peter Fleck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 22, 2003 1:05 AM Subject: Clearing a Form I have a cgi that creates a form and then receives the output of the form and sends it to a mysql database. It also displays the form information as a preview of what is getting sent to the database. You can return to the original form with data if you need to correct something via an 'Edit' button. This button also makes sure that nothing gets stored in the database (by deleting the data that was just sent and I know there must be a better way to do that part but it's not my current question). If the visitor uses the browser 'Back' button to return to the form, their data will be there but the record won't get deleted from the database. How do I erase all the data from the form if the visitor chooses to use the Back button? I tried the CGI.pm method mentioned in O'Reilly's CGI Programming: print $dataIn->header( -type => "text/html", -expires => "now"); but that doesn't do it. I'm wondering if javascript is the answer? Thanks. -- Peter Fleck Webmaster | University of Minnesota Cancer Center Dinnaken Office Bldg. 925 Delaware St. SE Minneapolis, MN 55414 612-625-8668 | [EMAIL PROTECTED] | www.cancer.umn.edu Campus Mail: MMC 806 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Bolding and Underlining.
I have an input coming from scrolling textbox eg. $description = qq~ This is my description. Here goes a couple of headings in it Heading abc: this is the heading one and needs to bold and underlined Heading xyz: needs to bold and underlined too. description continues here ~; I am producing HTML files from input. I need to underline and make bold these headings when the output is generated. Any ideas how to extract and make the changes in headings only for output? The two definate markers for these headings are there is always a line break before and after the heading and it always contains the colon at the end : Thanks for any input Sara.