in reply to How can I read records from a table in a database and represent it in a hash?

while your description makes _no_ sense, I will try to explain.

Most literally, you can't. Try an array of hash refs:

my $sth = $dbh->prepare(<<__SQL__); SELECT * FROM $table; __SQL__ $sth->execute; my $table_data = []; push @{$table_data}, $_ while $sth->fetchrow_hashref; $sth->finish;
On the other hand, if you have an id column ( eg. primary key ), you could easily make it ( or any other column, for that matter ) a key in a Hash of Hashes:
my $sth = $dbh->prepare(<<__SQL__); SELECT * FROM $table; __SQL__ $sth->execute; my $table_data = {}; $table_data->{$_->{id}} = $_ while $sth->fetchrow_hashref; $sth->finish;
Enjoy!
--
Casey
    I am a Superhero.