How could I using perl to capture the value of the radio button and output it to a file..

I know how to output and write to a file.. but how do I capture the value so I can output the value of the file.. and then perhaps go to another page when the user has clicked on the option or submitted

Ok say I am writing a html code.. and in that html code I want to add some small perl commands, how do I do it? or do I write the perl commands uniquely and call them somehow when a particular action happens..

Like, how do I within a html transfering control to a perl interpreter.. or do I type a peice of code at the start of the html to ensure both are immediately supported in the document so long as their is a perl interpreter in the server/or local machine.. agh hope this made sense :)

Server Side Include (SSI) is a technology supported by most modern web servers. In this method, certain HTML files are flagged (often by having a .shtml extension) as requiring extra processing as they are being requested by a browser. You can then put special comments into these files which can be a reference to an external program. That program is run and the results are inserted into the page in place of the comment. The best implementation of this is in Apache.

Alternatively, you can build up all of your page from within a CGI program. The best way to do this is using a template system (I recommend the Template Toolkit). Using this method, your CGI program builds up a data structure containing all of the required data which it then passes to the template processor along with the name of a template. The template processor then expands the template, replacing special tags with the contents of the data structure.