in reply to CGI , HTML

You should see this article by perrin:

Choosing a Templating System

It goes over most of your options for a templating system (I also recommend HTML::Template for its simplicity).

Another method would be designing the site with a 100% CSS layout. This would allow you to "reskin" the sites simply by loading different stylesheets. Here is an example of that method. This is my preferred method but requires pretty good knowledge of CSS.