in reply to Hash of Arrays versus Two Hashes

Keep them separate only if you need to do complex things dealing with them in distinction from one another. It sounds like generally you need both pieces of data, so it makes sense to keep them together in light of the extra resources required for another entire hash. I suggest accessing the array elements though using constants, so you'd have:

use constant SCORE => 0; use constant NUM_MATCHES => 1; my $num = $various_scores{$this_document}[NUM_MATCHES];

Adding further entries, which should occur fairly infrequently, is merely a matter of adding new constants.


"The dead do not recognize context" -- Kai, Lexx