I am trying to create several hashes that collects data from several unknown amount of tables. I then am trying to save these hashes into another hash and use a reference number to each tables hash. I am having a lot of trouble doing this, any help would be outstanding. This is what I have attempted so far:

$numberOfTables = 3;
my $tableNum = 1;
my $tables = [];
while(numberOfTables) {
my %tableElements = ('field1' => $field1 ,
'field2' => $field2);

$tables->[$tableNum] = %tableElements;

$numberOfTables--;
$tableNum++;
}
my %finalHash = ('table' => $tables);
2 hours ago - 4 days left to answer.


I was hoping to be able to call each element using the following:
$finalHash- {table}- [1]- {field1}