or download this
my $lowIndex = BinSearch ($lowerlimit, sub {$_[0] <=> $_[1]}, $matches
+{$element}{$sitekey}) + 0.5;
my $highIndex = BinSearch ($upperlimit, sub {$_[0] <=> $_[1]}, $matche
+s{$element}{$sitekey});
my @arrayA = @{$matches{$element}{$sitekey}}[$lowIndex..$highIndex];