Trie sample in Perl