in reply to Reading from a text file for cgi output

You may want to look into Server Side Includes for this. Server side includes allow you to insert arbitrary text (or HTML, or sometimes scripts) into a webpage by adding an include directive inside HTML comment tags, e.g. <!--#include virtual="/includes/header.txt"-->.

Most web servers support this but if you aren't the server administrator you may find that it has been disabled for security reasons. Definitely do some research before you leap into this method since you could open up security holes depending on the configuration of the server.

--
Grant me the wisdom to shut my mouth when I don't know what I'm talking about.