Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: META tags in perl scripts



On Wed, Jun 07, 2000 at 10:02:59AM +0900, Beth Noble wrote:

> I am doing the following--
> The perl script parses the results of an HTML form and opens file.html to
> write them there. (actually it creates file.html in HTML format with the
> results in the body). Then I want the browser to immediately display
> file.html with the updated results.
> So I open, write to, and close file.html and have the following lines

Maybe I'm missing something, but this looks like it should be handled in
Perl, not HTTP.

You contact the CGI, and it fires back the text of the form.  Then the CGI
effectively dies.

Your browser reads the form and displays it for the user.  The user types
in data.  The user then hits the "Submit" button.  This contacts the
server, which fires up a fresh instance of the CGI and force-feeds it the
data from the user's form, plus any other parameters lurking in hidden
tags.  The browser then waits for some sort of browser-friendly response
from the server.

The CGI cranks up, sees the content of the form, and understands that it
should create the file you're after.  It writes the file.  So far, nothing
has been sent back to the browser, which is patiently waiting for a
response.  If the file is HTML, why not just use Perl to stream it onto
STDOUT?  If it needs massaging for display, Perl can do that too.

In this case the user will be looking at the URL of the CGI rather than
that of the file itself, and that will show up in the address box.  Is
that a problem?

... somehow I have the feeling I'm about to undergo a learning experience 
on this one. :-) 

Cheers,
----
-x80
Frank G Bennett, Jr         @@
Faculty of Law, Nagoya Univ () email: bennett@example.com
Tel: +81[(0)52]789-2239     ()

-----------------------------------------------------------------------
Next Meeting (w/ YLUG): June 16 (Fri) 19:00 Mizonoguchi Marui Family 12F
Next Technical Meeting: July 8 (Sat)  13:30 Topic: TBA
-----------------------------------------------------------------------
more info: http://www.tlug.gr.jp        Sponsor: Global Online Japan


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links