in reply to CGI SSI and Apache2

With Apache2, you don't need to use workarounds like this. It is capable of processing SSI in your CGI output. Look at the mod_include docs.