It looks like you're trying to perform a server side include. This allows you to include the output of a CGI program in an otherwise static HTML page. But what you have here is not an HTML page but rather another CGI program. You can achieve this result, somewhat primitively, using the do function in Perl.
That should be enough to get you started. But I'd suggest taking this CGI you're trying to include and turn it into a module whose functions you can call from your main script. Try Simple Module Tutorial for starters if you're not familiar with modules.