sub post { my $c = shift; my $app = $c->app; if ( $app->recaptcha_verify ) { my $p = $c->req->body_params->to_hash; #... test for missing data #build sql string and add the data $app->log->debug($sql); my $stm = $app->db1->prepare($sql) or die $app->db1->errstr; $stm->execute() or die $stm->errstr; $app->stash( msg => "Data well received, thank you" ); } } else { if ( my $err = $app->recaptcha_get_errors ) { foreach my $e ( @{$err} ) { $app->log->debug( "Error code : " . $e ); } } else { $app->log->debug("Surv.pm: could be a bot here"); } } }