in reply to Perl and MySql - checking tables for column names

It wouldn't be portable to databases other than mysql, but you can query directly for table names:

SELECT table_name FROM information_schema.tables;

And, then to get column names for a specific table

SELECT column_name FROM information_schema.columns WHERE table_schema += 'your_database' AND table_name = 'your_table';