in reply to Hash of Array Comparision...
Even if you do minimize the looping, there will be a performance penalty for your do() call within the loop. Better to prepare a statement with placeholders outside and execute it repeatedly.
my $dbh = DBI->connect("DBI:mysql:database=DATA;..."); my $sth = $dbh->prepare("INSERT INTO DATA VALUES(?, ?)"); foreach my $key (keys %hash1) { # check other hash $sth->execute($data1, $data2); }
|
|---|