good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
There is nothing wrong with your logic. It is worthwhile, however, to try to make associated data stick together, and avoid data structures which must be maintained in parallel. I would try to make that data an AoH where the array maintains order, and the hash provides data that is clearly associated:
The merits of zero based arrays come from C practice, where an array is synonymous with a pointer to its first element. Adding n element sizes gives the address of the n'th element. In Perl, it is best to treat arrays as 'things' and avoid representation dependent methods, but indices are available if you need them. For question 2, It depends on your data structure. I'd expect grep to play a part. After Compline, In reply to Re: Array indices
by Zaxo
|
|