Oops missing the compare function.
 sub _compare { $_[0] <=> $_[1] }

Keys are numeric bins of the form 10000.000178 - this adapted from a mysql strategy where we are testing for bins within the boundaries but I am interested in an in-memory adaptation.

I want to iterate through a subset of the keys that are bounded by some values $begin, $end not the whole set of keys as is demonstrated in all the examples. I was using get_dup to initialize the cursor and then iterate through all the available keys, however the cursor will only point to keys which have >1 value.
===
Ahem. I was making it harder than it should be.

$bhandle->seq($start,$v,R_CURSOR); while( $bhandle->seq($k,$v,R_NEXT) == 0 ) { last if( $k> $end); ... }
Gets me what I want. Calling get_dup to initialize the cursor was not a smart idea and was the root of the problem.

In reply to Re: (podmaster) Re: In order traversal of BTREE keys where not all keys have duplicate values (using DB_File) by stajich
in thread In order traversal of BTREE keys where not all keys have duplicate values (using DB_File) by stajich

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.