My suggestion would be to first NOT use MySQL at all, and check if your code can properly get the form data and print it out. This way you know what data the user is entering without the need to debug any mysql related problems.
I also suggest you use the CGI methods to get the form data. You should be selective about what form data you need from the user. For example, to get the the value of a text input field named first_name, in your CGI script, you should do this:
my $first_name = param('first_name');