On Fri, 18 Jan 2002 at 09:21 -0500, John Peacock <[EMAIL PROTECTED]> wrote:

> From: John Peacock <[EMAIL PROTECTED]>
> To: Rich Bowen <[EMAIL PROTECTED]>
> Cc: David Dyck <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Date: Fri, 18 Jan 2002 09:21:11 -0500
> Subject: Re: Version numbers in cpan index databases inconsistent with
>     Date::ICal
>
> Rich Bowen wrote:
> >
> > On Tue, 15 Jan 2002, David Dyck wrote:
> >
> > > One example that is used in some of the perl distribution to format
> > > Revision numbers uses sprintf like this:
> > >     $VERSION      = sprintf("%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/);
> >
> > Well, yes, we could do that, but it's a little late now. I try to
> > release 1.10 as the first version of most modules for this very reason,
> > but I don't usually mess with it for modules, like this one, that are
> > not the main module in the distribution. I see from your comments here
> > that it is perhaps something that I should think about more.
> >
> > Yes, we could bump the next version up to 1.61. I'll mention this to the
> > rest of the development team.
>
> If you do decide to use the sprintf() style, please do this instead:
>
> $VERSION  = sprintf("%d.%03d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/);
>                           ^
>
> since that corresponds to the default version format that Perl itself uses
> (i.e. 3 places between decimals).  I actually have web modules with over 99
> subversions (which means of course that I should block update all the modules
> to the next major version ;~).

if 3 digits is prefered, then the example in perlmod should be changed

            # if using RCS/CVS, this may be preferred
            $VERSION = do { my @r = (q$Revision: 2.21 $ =~ /\d+/g); sprintf 
"%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker

but perlmodlib does add the "at least" so it doesn't imply a limit of 2

          o   Give the module a version/issue/release number.

               To be fully compatible with the Exporter and
               MakeMaker modules you should store your module's
               version number in a non-my package variable called
               $VERSION.  This should be a floating point number
               with at least two digits after the decimal (i.e.,
               hundredths, e.g, "$VERSION = "0.01"").  Don't use
               a "1.3.2" style version.  See Exporter for
               details.


I haven't had time to examine some of the core modules that
parse version numbers.


Reply via email to