in reply to How a HTML radio button on click calls a CGI function?

Am not replying to the question you have asked, just adding a suggestion to the code snippet you had posted
There are functions in cgi that does this, for ex:textarea
Here is a sample how you could do that
$cgi>textarea( -name => $box_name, -rows => $no_of_rows, -maxlength => $max_length, -cols => $no_of_cols );

instead of using print statements to print html code directly
this is more readable and maintainable