in reply to SSI usage in CGI scripts

I'm not aware of any servers that have configurations that will process pages created through CGI for SSI.

It's a mutually exclusive situation -- you can use SSIs, CGI, or some other text processing engine (ColdFusion, PHP in non-CGI mode, etc.)

And then we get to the exceptions -- it is possible through mod_perl to define your own handlers. It may be possible to throw something back to the SSI processor, but I've never attempted such a thing, and wouldn't really know where to start.

As another possibility, rather than using CGI, you could use embperl, and there is a handler to mix the two. (I don't know what order they're called, so if the embperl can emit an SSI instruction to be processed by the SSI engine)