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$//;