First work out what your HTML output needs to look like - it should then be simple to produce this via your CGI script. The easiest way to acheive your desired result is to add an "onchange" event handler to the HTML select element so that the output looks more like:
<select name="whatever" onchange="this.form.submit()">
Note that it is best practice to provide a submit button as well, so that the form is fully functional for those users with JavaScript disabled.
It is also preferable to keep event handlers out of your markup and assign them via a separate JavaScript layer, but I'll leave you to Google that one.