use warnings; use strict; # example data my @dbcolumn = qw/ site_id site_store_type project site_city site_state site_country project_begin /; my @splitarray = ('9999','SC OSR','Prebuild','Penfield','NY','US','8/8/2016 '); # make a hash out of two arrays of the same length my %data = map { $dbcolumn[$_] => $splitarray[$_] } 0..$#dbcolumn; # build the SQL statement use SQL::Abstract; my $sql = SQL::Abstract->new; my ($stmt, @bind) = $sql->insert('database.database', \%data); # debug: display the Perl variables holding the SQL use Data::Dumper; print Dumper($stmt, \@bind); __END__ $VAR1 = 'INSERT INTO database.database ( project, project_begin, site_city, site_country, site_id, site_state, site_store_type) VALUES ( ?, ?, ?, ?, ?, ?, ? )'; $VAR2 = [ 'Prebuild', '8/8/2016 ', 'Penfield', 'US', '9999', 'NY', 'SC OSR' ];