# Prepares the insert statement string, using results of preinsert. sub insertstr { my $tbl = shift; my %fields = @_; my $str = "insert into $tbl set"; foreach (keys %fields) {print STDERR "$fields{$_}\n"; $str .= " $_=\'$fields{$_}\',";} #watch this print: chop($str); print STDERR "$str\n"; return $str.";"; }