Perl module that implements a generic binary search algorithm