Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    
    ...
        }
        return($min_found_ix, $max_found_ix);
    }
    
  2. 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
    
  3. 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;
    
  4. or download this
    package MyClass;
    
    ...
            _gen_value($self->{'params'}) #; Generate the expensive value 
    +and store it in the cache.
        };
    }