List::Range - Range processor for integers
use List::Range; my $range = List::Range->new(name => "one-to-ten", lower => 1, upper => 10); $range->includes(0); # => false $range->includes(1); # => true $range->includes(3); # => true $range->includes(10); # => true $range->includes(11); # => false $range->includes(0..100); # => (1..10) $range->includes(sub { $_ + 1 }, 0..100); # => (1..11) $range->excludes(0..100); # => (11..100) $range->excludes(sub { $_ + 1 }, 0..100); # => (0, 12..100)
List::Range is range object of integers. This object likes 0..10.
0..10
Create a new List::Range object.
Name of the range. Defaults "".
""
Lower limit of the range. Defaults -Inf.
-Inf
Upper limit of the range. Defaults +Inf.
+Inf
Returns the values that is included in the range.
Returns the values that is not included in the range.
Returns all values in the range. (likes $lower..$upper) @$range is alias of this.
$lower..$upper
@$range
Number::Range Range::Object Parse::Range
Copyright (C) karupanerura.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
karupanerura <karupa@cpan.org>
To install List::Range, copy and paste the appropriate command in to your terminal.
cpanm
cpanm List::Range
CPAN shell
perl -MCPAN -e shell install List::Range
For more information on module installation, please visit the detailed CPAN module installation guide.