title: Perl CGI Form reusing previous data
body: <p>I am building a signup form with Perl (using the <a href="http://p3rl.org/CGI" rel="nofollow">CGI</a> module) and a recaptcha. The form works fine and submits the data to a SQL database. However, when I create another user with the form, the data entered into the database is the same as the first user. I am retrieving the form data in my verification page using <code>my $var = $cgi-&gt;param('param_name');</code> Do I need to clear the params, or is it something else. (I tried <code>$cgi-&gt;delete_all();</code> but that didn't seem to do anything)</p>
  
  <p>Form Verification Code: (It is literally a prototype, so security has not been addressed yet)</p>
  
  <pre><code>my $challenge = $q-&gt;param('recaptcha_challenge_field');
  my $response = $q-&gt;param('recaptcha_response_field');
  my $username = $q-&gt;param('Username');
  my $password = $q-&gt;param('Password');
  my $name = $q-&gt;param('Name');
  my $email = $q-&gt;param('Username');
  my $security = $q-&gt;param('Security');
  my $answer = $q-&gt;param('Answer');
  my $permissions = 1;
  
  # Verify submission
  my $result = $c-&gt;check_answer(
      "my_private_key", $ENV{'REMOTE_ADDR'},
      $challenge, $response
  );
  
  if ( $result-&gt;{is_valid} ) {
      insert_new_user();
      print  $q-&gt;redirect('cgi-bin/admin/text_campaign.pl');
  }
  else {
      # Error
      print  $q-&gt;redirect('login.pl?crc=false');
  }
  
  ###############################################################################
  # Sub Routines                                                                #
  ###############################################################################
  sub insert_new_user
  {
      my $sql = "INSERT INTO users (u_username, u_password, u_realname, u_email, u_security_question, u_security_answer, PRIVILEGES_idPRIVILEGES)
                 VALUES(?, ?, ?, ?, ?, ?, ?) ";
      my $sth=$dbh-&gt;prepare($sql);
      $sth-&gt;execute($username, $password, $name, $email, $security, $answer, $permissions);
      $sth-&gt;finish();
  
      return;
  }
  </code></pre>