in reply to exec CGI

You appear to mixing up apache's Server Side Include's with CGI. If you're executing a CGI to generate the heredoc, why not just execute the catdisplay.pl within the cgi script?
-derby