From c3b5c8ab9999f12b55ddae1c04a590a4123e1a31 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 6 Oct 2017 17:14:28 +1300 Subject: Use direct defined test not -Inf/Inf This caused failing tests on Perl v5.8, as reported by CPANTS --- lib/List/Breakdown.pm | 9 ++++++--- 1 file 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 -- cgit v1.2.3