DBD::mysql::st execute failed: called with 26 bind variables when 24 are needed at csv2sql.pl line 18, line 193. #### ("foo","bar","","bash") #### #!/usr/bin/perl -w use strict; use DBI; my $dbh = DBI->connect("DBI:mysql:db;host=host.com", 'user', 'pw') or die ("Could not connect: " . DBI->errstr ); open GLEANDATA, 'gleandata.csv' or die "Could not open file\n"; my @row; my $sth; my $line; while () { $line = $_; my @row = split(/:/, $line); $sth = $dbh->prepare("INSERT INTO glean_data (gleaner, contact_name, title_position, city, county, phone, email, dates_called, possible_donation, notes_comments, followup_needed, mailing_address, physical_address, crops, specific_crop, estimated_quantity, estimated_labor, possible_glean_dates_times, ladders_to_lend, picking_bags_to_lend, bins_or_boxes, existing_relationship, status, time_of_year_to_call) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); $sth->execute(@row); } close GLEANDATA or die "Could not close file\n"; $dbh->disconnect; #### CREATE TABLE glean_data ( id MEDIUMINT NOT NULL AUTO_INCREMENT, gleaner VARCHAR(50), contact_name VARCHAR(50), title_position VARCHAR(50), city VARCHAR(50), county VARCHAR(50), phone VARCHAR(20), email VARCHAR(50), dates_called VARCHAR(200), possible_donation VARCHAR(150), notes_comments VARCHAR(5000), followup_needed VARCHAR(50), mailing_address VARCHAR(100), physical_address VARCHAR(100), crops VARCHAR(150), specific_crop VARCHAR(150), estimated_quantity VARCHAR(150), estimated_labor VARCHAR(150), possible_glean_dates_times VARCHAR(500), ladders_to_lend VARCHAR(150), picking_bags_to_lend VARCHAR(150), bins_or_boxes VARCHAR(50), existing_relationship VARCHAR(150), status VARCHAR(150), time_of_year_to_call VARCHAR(50), PRIMARY KEY (id) )