- or download this
#!/usr/bin/env perl
...
}
return($min_found_ix, $max_found_ix);
}
- or download this
Looking for the range 232, 339 in an array with 100 elements
FETCH (miss) 1: 49
...
FETCH (miss) 11: 85
FETCH (hit) 1: 86
Found indexes of 56, 86
- or download this
use List::BinarySearch qw(binsearch_range);
...
}
my ($low_ix, $high_ix) = binsearch_range { $a <=> $b->fetch } $min_wan
+ted, $max_wanted, @array;
- or download this
package MyClass;
...
_gen_value($self->{'params'}) #; Generate the expensive value
+and store it in the cache.
};
}