my $sth_insert_article = $dbh->prepare( qq(INSERT INTO article (url, html_extr_text, concord_file, sys_time) VALUES (?, ?, ?, ?))) or die "Unable to prepare insert statement: " . $dbh->errstr; foreach my $article_index (0 .. @output_concord_files_prepare) { my $records_inserted = $sth_insert_article->execute($url_prepare[$article_index], $html_pages_files_extended[$article_index], $output_concord_files_prepare[$article_index], $sys_time_prepare[$article_index]); if ($records_inserted != 1) { die "Error inserting records, only [$records_inserted] got inserted: " . $sth->insert_article->errstr; } }