in reply to 2 script in a page

You might consider using SSI for this.
<html> <body> <div style="float: left" class="sidebar"> <!--#include virtual="/cgi-bin/build-sidebar" --> </div> <!--#include virtual="/cgi-bin/build-body" --> </body></html>
The advantage of this approach is that you aren't limiting yourself to using CGI to generate your page body. You could put a static piece of HTML content in there just as easily.