in reply to Re^2: Sql table names
in thread Sql table names

Now that I see what you're doing, yes, I think some kind of a hash makes sense. You wrote:
a table may be queried for its contents by supplying its name through an online form.
In that case, you definitely want to check the name against the hash to make sure it's a table you want users to be able to access. You may also want something like this, depending on your needs:
my @tables = ( {name=>members,cols=>[qw(members id)]}, {name=>emails,cols=>[qw(emails member_id)]}, ); my $sql = "SELECT " . join(',',@{$tables[0]->{cols}}) . " FROM " . $tables[0]->{name} ;
Eventually you might consider Class::DBI which provides some ready-made shortcuts for this kind of thing.