use strict; use warnings; use DBI; use feature 'say'; my $dbh = DBI->connect("DBI:mysql:quote_test:localhost","user","test"); my $sql = 'INSERT INTO test (id, name, result) VALUES '; my @tests = ( [ 1, 'quote', 'ok' ], [ 2, 'rose', 'nok' ], [ 3, 'blue', 'ok' ], [ 4, 'hex', 'nok' ], [ 5, 'quote', 'ok' ], ); my (@binds,@tests_sql); for my $test ( @tests ) { push @tests_sql, '(?,?,?)'; push @binds, @{$test}; } $sql .= join ',', @tests_sql; my $sth = $dbh->prepare( $sql ); $sth->execute(@binds);