Hi all, I've a large table of data about organisms from which I should access data to do statistics. The table can change and I have to easily change the code accordingly. Different subroutines will access this table in different ways. So

I thought to load all the table in an array A[N][M] and keep a PERL variable for each of the columns such that if I have to access a field $fieldA I can simply access A[x][fieldA].

Of course I have to set, for each field variable, the corresponding index number: $fieldA=0, $fieldB=1,..,$fieldM=M

If I have to add a column I have simply to change the correspoding index.

Re: [angeloulivieri] A suggestion on how to work on a table
[In reply to]

Can't Post

Your approach would be ideal in languages which do not have hashes. In perl, I would prefer to use an array of hashes (refer: perldoc perldsc). Use your scheme only if the redundant storage of the field names requires excessive memory. Good Luck, Bill