+ foreach $field ( @fields ) {
+ if $cgi->param( $field )
+
+ my $statement = 'INSERT INTO PERSONS ( ',
+ join(', ', @fields ),
+ ' ) VALUES ( ',
+ join( ', ', map { $cgi->param($_) } @fields ),
+ ' )'
+ ;
+ my $sth = $dbh->prepare($statement)
+ or die $dbh->errstr;
+ my $rv = $sth->execute;
+ die $sth->errstr unless $rv;
+
+ print $cgi->header,
+ "person added?"