aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/List/Breakdown.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/List/Breakdown.pm b/lib/List/Breakdown.pm
index 42c610e..8aac1c9 100644
--- a/lib/List/Breakdown.pm
+++ b/lib/List/Breakdown.pm
@@ -35,9 +35,12 @@ my %types = (
my $bounds = shift;
@{$bounds} == 2
or croak 'ARRAY ref for bounds needs two items';
- my $l = defined $bounds->[0] ? $bounds->[0] : '-Inf';
- my $u = defined $bounds->[1] ? $bounds->[1] : 'Inf';
- return [ grep { $_ >= $l and $_ < $u } @_ ];
+ return [
+ grep {
+ ( not defined $bounds->[0] or $_ >= $bounds->[0] )
+ and ( not defined $bounds->[1] or $_ < $bounds->[1] )
+ } @_,
+ ];
},
# If it's a subroutine, return a arrayref of all elements for which it