http://www.perlmonks.org?node_id=183693


in reply to called with 19 bind variables when 20 are needed, error

Personally I find something like this easier to read and definatly less error prone, the field names are only in one place:
my @fields = qw/cat itemid price des longdes size o1n o1o o2n o2o o3n o3o c1n c1v c2n c2v c3n c3v small large/; my $sql = sprintf 'INSERT INTO items (%s) VALUES (%s)', join(',', @fields), join(',', (?) x @fields); $dbh->do($sql, undef, map scalar param($_), @fields);

gav^