foreach my $count (1..$tables) { my $sql =<errstr) if (!($dbh->do ($sql))); }