in reply to Howto: Comparator for B-Tree in Kyoto Cabinet

The easiest approach would be to make your keys lexically sortable by padding them:

my $key = sprintf "%010d-%010d", $low, $high;

This only works if you want to sort by start position and then by end position (or length).

Replies are listed 'Best First'.
Re^2: Howto: Comparator for B-Tree in Kyoto Cabinet
by Kraeze (Initiate) on Jul 03, 2015 at 11:51 UTC

    Hi Corion,

    Thank you for your reply. I see what your saying. I spent a few hours trying to determine how to write a comparator and yours seems to be the simpliest solution.

    Just to ensure that there is no method provided by the API, I emailed the author. I will post back here should I get a reply. I just thought the Perl Monks would be much faster and provide me with a clean, honest approach. Thanks again!