in reply to html output to a file

... the output won't go to the file.

Does anything go to the file? I'm guessing you need to take out the header line (since that prints the Content-Type needed by the HTTP protocol) and include the start_html line (since that includes the <title> tag (and other things) needed by the HTML standard. Commenting them both out is going to give you some malformed HTML.

Replies are listed 'Best First'.
Re^2: html output to a file
by ww (Archbishop) on Apr 27, 2007 at 17:29 UTC
    Kyle's point re header is worth noting, as the OP seems to reflect the view that the content sent by header, needs to be part of a valid .html file.

    It does NOT. Ultimately, in a cgi/server/browser context, it tells the browser how to render the rest of what's sent; it is NOT part of a basic .html file which begins with the content sent by start_html. Since OP is merely outputting to a file, it's not necessary.

    (The notes from Corion and others may make this unimportant at the moment, but at some time, a misunderstanding could jump up and bite.)