# ungetestet my @keys = grep { defined $self->{$_} and $_ ne 'ID' } keys %$self; my $fields = join ',', @keys; my $values = join ',', ('?') x @keys; my $stmt = "INSERT INTO job ($fields) VALUES ($values)"; my $sth = $dbh->prepare($sth); $sth->execute(@$self{@keys});