My apologies, jZed, and thanks for replying.
Each key of the hash stores the table name and the name of column to be sorted (just in case sorting is required). The table names themselves are hardcoded and do not come from an external source. However, a table may be queried for its contents by supplying its name through an online form.
The hash I was talking about is as follows
%table =(
members => [ qw(members id) ],
emails => [ qw(emails member_id)]
};
So, instead of
SELECT * from members
It's
SELECT * from $table{'members'}[0]
Does hashing the table names make sense?
One use I could think of is verifying the table's existence when it's being queried (as in an web application). |