in reply to Re: html output to a file
in thread html output to a file

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.)