I see
CGI::SSI over at CPAN, which appears to do exactly what you want; in your case, you'd want to process the CGI to do that variable inclusion that you appear to have, then pass that parsed text to this module to handle the CGI processing.
Mind you, this is quickly desending into the realm where a templating system would be better, but I doubt your specificiations allow for that at this time.
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain