[VPM] CGI questions, and O'Reilly
Michael S. Joyce
michael at negativespace.net
Thu May 15 22:49:26 CDT 2003
The problem is that you are sending your output to a file. You don't need a
header when your output is a file. Browsers know that html files are html
files. (Sorry, that wasn't meant to sound condescending, but I couldn't
think of a better way to say it.)
For a CGI program, you just send your output to STDOUT. The web server
intercepts the output and then sends it off to the web browser.
So, short answer: if your printing into a file handle, don't bother with
the header.
Michael
At 05:40 PM 05/15/2003 -0700, you wrote:
>Curses, though I am interested in the O'Reilly pass, I cannot afford even
>accomodations/transport I am sure. Although I might be able to convince my
>boss to send me, I can't be certain of this...so I guess you can count me
>in...
>
>I also have a couple of CGI questions.
>
>I've written this CGI that creates a form (I could have used straight HTML
>much more easily, or functional syntax, but I am trying to learn OO CGI.pm).
>In every CGI tutorial I've read, printing the Content-Type header is
>mandatory
>so that the cgi knows what it's looking at. So, the first thing my CGI
>object
>does is call header(). However, in the resulting HTML page, this sticks out
>like a sore thumb. Question 1: am I stuck with this? I'm also getting
>infuriating warnings from Perl as follows:
>
>
>[Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in length at
>(eval 8) line 11.
>[Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in join or
>string at (eval 15) line 15.
>[Thu May 15 17:54:23 2003] test.cgi: Use of uninitialized value in join or
>string at (eval 15) line 15.
>
>I'm not sure what these mean, or if I should worry about them since they
>don't
>hinder in any way the generation of my form page. Question 2: What is the
>concencus on this?
>
>I've attached the script itself as well as the HTML page I get from running
>it.
>
>Thanks,
>
>Nathanael
>
More information about the Victoria-pm
mailing list