Skip Menu |

This queue is for tickets about the Number-Range CPAN distribution.

Report information
The Basics
Id: 15478
Status: resolved
Priority: 0/
Queue: Number-Range

People
Owner: LARRYSH [...] cpan.com
Requestors: noodles [...] earth.li
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.06
Fixed in: (no value)



Subject: Problem showing lone number at start of range.
Given a set of numbers like "1,3,4,5,6" ->range will return "1..1,3..6" in the scalar context, rather than the expected "1,3..6". The attached patch fixes this for me.
diff -ruN Number-Range-0.06.orig/lib/Number/Range.pm Number-Range-0.06/lib/Number/Range.pm --- Number-Range-0.06.orig/lib/Number/Range.pm 2005-11-02 11:31:32.000000000 +0000 +++ Number-Range-0.06/lib/Number/Range.pm 2005-11-02 11:31:49.000000000 +0000 @@ -146,7 +146,7 @@ else { my @range = $self->range; my $previous = shift @range; - my $format = "$previous..$previous"; + my $format = "$previous"; foreach my $current (@range) { if ($current == ($previous + 1)) { $format =~ s/\.\.$previous$//;
Sorry this took so long. Resolved in 0.07