| Next | Lightweight Databases | 88 |
blue 4
green 5
orange 6
red 3
violet 6
yellow 5
Because the keys in a B-tree are in order, you can do limited partial matching
As with Search::Dict, you can look for the first key that begins with some string
my $db = tied %hash;
my $k = "g";
$db->seq($k, $v, R_CURSOR);
print "$k => $v\n";
green 5
Actually it produces the first key that is greater than or equal to $k
Under the appropriate comparison
If there is no such key, $k is unchanged, $v is undef, and seq returns true
| Next | ![]() |
Copyright © 2003 M. J. Dominus |