I ended up creating a %dbh hash with $table as the index along with one Operating System file for each table. I was hoping there was a way not to create so many Operating System files because of the extra Administration they require. can you think of any way around this? I read all my data from a log and I am creating multiple Tables based on the content of the data in the log.
Each time you create a table, squirrel away the text of the INSERT statement (and any other table-related queries) by storing it in a hash keyed by the table name or the like. Then, when you're done creating the tables, loop over the stored queries creating prepared sth's.