1) holds the basic table data
%T{tableName}=[['A','B',undef,'C'],['1','2',undef,'3'],['1','2',undef,'67']];
2) hold the column names for each table
%C{tableName}={ 'serialno' => 0,
'type' => 1,
'hardware' => 2,
'software' => 3,
});
3) holds any required indexes
%I{tableName}{_checksum}{'A'}=ref_to_row ['A','B',undef,'C']
%I{tableName}{_checksum}{'1'}=ref_to_row ['1','2',undef,'3']
####
foreach $row (@{getTable(tableName}) # getTable() returns the ref from $T{tableName};
{
$row->[getColumn(tableName,'software']='updated'; # getColumn() simply returns the result of $C{tableName}{colName}
}
####
foreach $row (@{getTable(tableName}) # getTable() returns the ref from $T{tableName};
{
$row->column('software'); # using OO in some way ?
or
element($row,'software) # not so good - uses a hash of row reference addresses to enable me to find which table any row is in
}