- or download this
for ( date2offset($start) .. date2offset($end) ) {
push @{$effective[$_]}, \$data;
}
- or download this
my $results = $effective[date2offset($date)]; # O(1)
if ( defined($results) {
# @$results is an array of all matching $data
}
- or download this
sub date2offset {
my($yyyymmdd) = @_;
...
my $day = $mmdd % 100 - 1;
return $year * (12 * 31) + $month * 31 + $day;
}