my $results = $effective[date2offset($date)]; # O(1) if ( defined($results) { # @$results is an array of all matching $data }