update table A, table B set A.field1 = B.field1 where A.field2 = b.field2 #### $rows_affected = $dbh->do($querystr);