in reply to Basic CGI

the idea of the two files that Chady posted is probably what you want in terms of how to have two files, where one file contains HTML embedded in functions and one file contains the the 'controlling' parameters (i.e. which functions to call).

All I'd add is be careful when using the here document tags. As Chady showed the here document allows HTML to be written as raw text without having to escape quotes, put in print statements etc. The basic syntax is to have a print << followed by the ending tag. So you end up with something like:

print <<Ending_tag; Ending_tag

For the ending tag to work there are a few *important* rules to remember: