in reply to Recursive hash assignment

Hopefully to help a little ..

The data comes off of the database into an array, which is hashed using the column names determined earlier as keys. This gives a (temporary) hash with the following structure (called %tblData in the above):

$tblData{$columnname} = data from array

for each column name.

This then needs to be added to a permenent hash (called %tableData above) keyed on one or more of these column names, the keys being provided by the user. (it's part of a sub that takes a table name and list of keys and returns a hash). This should give the structure:

%{$tableData{$key1}{$key2}{$key3}} = %tblData

ie creating a hash of hashes which could be accessed using, for example,
my $data = $tableData{$key1}{$key2}{$key3}{$columnname}.

--Foxcub.

Replies are listed 'Best First'.
Data for 2 keys ..
by Tanalis (Curate) on Sep 05, 2002 at 09:53 UTC
    'ID0001' => { 'TR0001' => { 'transaction_id' => '101', 'paymethod' => 'csh', 'payee' => '921', 'pay_date' => '20020902' 'authorised' => 'LDG' }, 'TR0002' => { 'transaction_id' => '102', 'paymethod' => 'csh', 'payee' => '921', 'pay_date' => '20020904' 'authorised' => 'LDG' }, 'TR0003' => { 'transaction_id' => '103', 'paymethod' => 'csh', 'payee' => '921', 'pay_date' => '20020905' 'authorised' => 'DMB' } }, 'ID0002' => { 'TR0001' => { 'transaction_id' => '141', 'paymethod' => 'csh', 'payee' => '253', 'pay_date' => '20020902' 'authorised' => 'LDG' }, 'TR0002' => { 'transaction_id' => '142', 'paymethod' => 'csh', 'payee' => '254', 'pay_date' => '20020903' 'authorised' => 'MDB' }, 'TR0003' => { 'transaction_id' => '162', 'paymethod' => 'chq', 'payee' => '253', 'pay_date' => '20020905' 'authorised' => 'DMB' } }
    .. etc ..

    --Foxcub