# prepare once, execute often my $sth= $db->prepare("INSERT INTO drives (system_id, make, model, capacity, status, last_update) VALUES (?,?,?,?,?,NOW())"); foreach my $drive (@drives) { $sth->execute($drive->{system}, $drive->{make}, $drive->{model}, $drive->{capacity}, $drive->{status}); }