Show quoted text>>>>> On Thu, 31 May 2007 19:55:05 -0400, " via RT" <bug-DateTime-Format-Natural@rt.cpan.org> said:
Show quoted text
Show quoted text > On Thu May 31 01:24:24 2007, ANDK wrote:
>> When you use version numbers that look like floating point numbers, they
>> are treated as floating point numbers, not as v-string. Which means that
>> 0.10 sorts before 0.9. This leads to the following version
> inconsistencies:
Show quoted text > Thanks for taking the time. I'm aware of floats and how they're handled,
> but I wasn't aware the CPAN indexer did likewise.
The indexer just follows perl's lead. When somebody says
use DateTime::Format::Natural::Base 3.14;
then perl also compares the version number with $VERSION as a floating
point number.
Show quoted text > But as I'm not sure how to proceed, I thought I could use a little
> input and may ask you for your advice.
The simplest advice I have is to append digits whenever you have
reached '0.9'. So if you prefer 3 digits after the decimal point, you
would switch to '0.901'.
Or you start in the 1.0 region now. And decide about the number of
digits after the decimal point again and keep it fixed. So maybe you'd
start with '1.00' and from there '1.01', '1.02', etc.
Your preferences decide. If you're only feeling fine with v-strings,
then you can follow the advice in the 'Perl Best Practices' book which
suggests
use version; $VERSION = qv('0.0.3');
all on one line. Personally, I have got used to floats and use them
consistently everywhere, but then I did not have a choice until
recently.
--
andreas