One question: does the order of the pair ($word1, $word2) matter? In other words (making the same assumption as to what you mean as bobf above), is:
I will notequivalent to:
will I notfor your purposes, or is it different?
Update: Since you say "I think I will be accessing these parings via the $word1-$word2 parings", why not use an HoH, with $word1 and $word2 stringified as the key to the outer hash, and populate it something like this:
# foreach group of three words $hash{$word1 . ' ' . $word2}{$word3}++;
Or, more generally, for any number of words in your 'chain':
# foreach group of n words in array @n_words my $nth_word = pop @n_words; $hash{join ' ', @n_words}{$nth_word}++;
And if the answer to my question in the first part of this post is that order doesn't matter, just change that last line to:
$hash{join ' ', sort @n_words}{$nth_word}++;In reply to Re: Trying to select the best data structure
by Not_a_Number
in thread Trying to select the best data structure
by chinamox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |