Langue: en

Version: 2005-12-05 (mandriva - 01/05/08)

Section: 3 (Bibliothèques de fonctions)


Data::LetterTree - Native letter tree Perl binding


     use Data::LetterTree;
     my $tree = Data::LetterTree->new();
     $tree->add_data('foo', 'stuff');
     $tree->add_data('bar', 'more');
     $tree->add_data('bar', 'stuff');
     foreach my $word (qw/foo bar baz/) {
     if ($tree->has_word($word)) {
         print "$word:" . $tree->get_data($word) . "\n";
     } else {
         print "$word: not found\n";


This module provides perl binding over a native implementation of a letter tree, allowing to index any kind of perl scalar variable by a large set of string with a reduced memory footprint over native perl hashes by sharing their prefixes.



Creates and returns a new "Data::LetterTree" object.

$tree->add_data($word, $data)

$tree->add_data($word, $data)

Add $word in the tree, pushing $data in indexed values.



Return a true value if $word is present in the tree.



Return all values indexed by $word as a list.


Guillaume Rousse, <>


Many thanks to Sebastien Aperghis-Tramoni and Rafae.l Garcia-Suarez for helping me with in my first XS steps... Copyright (C) 2005 INRIA

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.