The most common float <---> tuple translation approach (which is the
one Perl itself uses) involves the idea of zero-padded triplets.

D:\cpan\trunk\Perl-Dist-Strawberry>perl -e "print $]"
5.010000

As far as I know, when extended to CPAN versions, the convention has
been to pad out decimals to the nearest triplet, even if you are
collapsing out the _.

So 1.234_56 becomes 1.234560 in float form, or 1.234.560 in tuple form.

Just as the common 1.23 is 1.230 in float form, or 1.230.0 in tuple form.

Adam K

2009/4/23 Austin Schutz <t...@off.org>:
>
> It seems like most of the time the XX part is essentially two digits,
> where the leading 0 is implied, i.e.:
>
> 1.1.1 -> 1.01.01
>
>
> This could be directly compared with:
>
> 1.0101
>
> and would solve the case where
>
> 1.9.1 > 1.10.1
>
> Looks like the only case where that wouldn't work would be where the
> format looks like
>
> X.XXX_XX
>
> but thankfully nobody would ever do anything that silly (++$sarcasm)
>
> I don't remember the last time I saw a version w/ .XXX. in it other
> than perl itself.
>
> Austin
>
> On Wed, 22 Apr 2009 19:14:41 -0400
> David Golden <xda...@gmail.com> wrote:
>
>> I scanned the version numbers as parsed out of distribution filenames
>> on my minicpan and analyzed the generic format.  Since we're talking
>> about distribution version numbers and most of the time those will be
>> generated by M::B, EU::MM or M::I and applied to META.yml and the
>> filename, it's reasonably representative of the problem space.
>>
>> While there are probably some edge cases that I didn't parse
>> correctly, it's close enough to see what's out there.
>>
>> In the following table "X" is a digit (best viewed monospaced).  The
>> full analysis is here:
>> http://echo.dagolden.com/~xdg/format-analysis.txt
>>
>> OVERALL TOP FORMATS
>> X.XX        12986
>> X.X         1624
>> X.XXX       1048
>> X.X.X       754
>> X.XXXX      359
>> X.XXXXX     165  # Repository sequence numbers?
>> vX.X.X      138
>> X.XX_XX     89
>> X.X.XX      71
>> X           64
>> X.XX.X      62
>> X.XXXXXX    58
>> X.XX.XX     37
>> X.XXa       34
>> X.X.X.X     19
>> XXXXXXXXXX  19   # YYYYMMDDNN?
>> X_XX        18
>> XXXXXXXX    18   # YYYYMMDD?
>> X.XXb       17
>> X.XX_X      16
>>
>> -- David
>
>

Reply via email to