X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FSpot.pm;h=57cf2599a103e0c71d310da69487144387898ddb;hb=5b5f8288506a85aaaafd11e0fdd17564f82d9c5f;hp=cb91c18aead934482da1878bb292e7b1ad6672e6;hpb=f443f102c592af25cd3468b637324ff78cc58300;p=spider.git diff --git a/perl/Spot.pm b/perl/Spot.pm index cb91c18a..57cf2599 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -230,6 +230,7 @@ sub ftor my ($a, $b) = @_; return undef unless $a < $b; $b--; + my $d = $b - $a; my @a = split //, $a; my @b = split //, $b; my $out; @@ -239,7 +240,9 @@ sub ftor while (@b) { my $aa = shift @a; my $bb = shift @b; - if ($aa eq $bb) { + if (@b < (length $d) - 1) { + $out .= '\\d'; + } elsif ($aa eq $bb) { $out .= $aa; } elsif ($aa < $bb) { $out .= "[$aa-$bb]";