I almost don't even want to comment on this code because it
soooo hurts my eyes. Here's the first few bits of what I can contribute:
- Your quoting problem will disappear when you use placeholders. See the DBI manpage for details.
- Please, go a little easier on the shiftlock key.
- Variables that include numbers as part of the names are almost always a sign of misdesign.
- How much code will you have to change when you add the 63rd column to your spreadsheet? Isn't there any way to get column headings from the sheet, so you can do a real dynamic mapping of the needed columns?
- Short of that, how about not copying every variable all over creation, but simply creating a map (hash) from database name to positional index, and using that map both to create the columns to insert and to select the proper value from an array for the placeholder. There's other code here in the catacombs to show how to do that.
Seriously, that code would definitely flunk any code review I gave it.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.