in reply to Words in Words
While I'm not an expert on tries, there seems to be a lot of potential there for your stated problem. Give it a look.
Here's a trie implementation in Perl.
What can be asserted without proof can be dismissed without proof. - Christopher Hitchens
In Section
Seekers of Perl Wisdom