Subject: | Incorrect handling of leading zeros |
Date: | Thu, 18 Feb 2010 10:46:12 +0200 |
To: | <bug-Algorithm-Interval2Prefix [...] rt.cpan.org> |
From: | "Adrian Bartel (AR)" <bartelar [...] telkom.co.za> |
The module does not appear to correctly handle ranges with leading
zeros, which are relevant "when working with telephony switching
equipment".
For example,
my @prefixes = interval2prefix('02','03');
print join(',', @prefixes);
gives: 2,3
should be: 02, 03
my @prefixes = interval2prefix('001','100');
gives: 1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,100
should be:
001,002,003,004,005,006,007,008,009,01,02,03,04,05,06,07,08,09,100
my $regex = interval2regex('02','03');
('02' =~ /$regex/) ? print "match" : print "no match"
gives: no match
regards,
--------------------------------------------------------------
Adrian Bartel
email: bartelar@telkom.co.za
--------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This e-mail is subject to the Telkom SA electronic communication legal notice, available at :
http://www.telkom.co.za/TelkomEMailLegalNotice.PDF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~