- or download this
use Set::Range;
- or download this
my %set= ('1' => { lower => 0,
upper => 10,
...
lower_inclusive => 1,
},
);
- or download this
my $range=Set::Range->new(\%set);
print $range->getState('19', NUM_RANGE);
# prints "2"
- or download this
my %set= ('Jan' => { lower => '1/1/2001',
upper => '1/31/2001',
...
lower_inclusive => 1,
}, # Days in February
);
- or download this
my $range=Set::Range->new(\%set);
- or download this
print $range->getSet('1/11/2001', DATE_RANGE);
# prints "Jan"
- or download this
Pass new() a reference to a Hash containing the set
information.
- or download this
The hash defining the sets contains one hash per set
with at least 'upper' and 'lower' defined.
'upper_inclusive' and 'lower_inclusive' are optional
and are the equivalent of >= and <= for the upper and
lower set boundries.
- or download this
The set hash can look like this:
- or download this
{
...
upper_inclusive => 1,
},
}
- or download this
etc... The lower and upper values can either be
numeric values or date values in the form
mm/dd/yyyy or dd/mm/yyyy (see C<getSet> for
Euro-formatted dates)
- or download this
my $set = $range->getSet(10);
my $set = $range->getSet('1/14/2002', DATE_RANGE);