SPUG: version numbers and MakeMaker

Joshua ben Jore twists at gmail.com
Sun Feb 1 10:41:10 PST 2009

On Fri, Jan 30, 2009 at 2:58 PM, Ryan Corder <ryanc at greengrey.org> wrote:
> On Fri, Jan 30, 2009 at 02:01:37PM -0800, Joshua ben Jore wrote:
> | > VERSION => '0.1.2',
> [snip]
> | FWIW, you never want to use multi-dot version numbers in perl. It's
> | possible and version.pm goes to some effort to heal the past but
> | there's no point in re-inventing badness.
>    use version; our $VERSION = qv("0.1.2");
> On one line, just like that -- this is an "Extended Version" as documented
> in 'perldoc version'.  The documentation does state neither Module::Build nor
> ExtUtils::MakeMaker completely handles version objects natively, then again I
> use Module::Install as my build-system.
> Damian Conway goes into detail on why you need to do it this way and why it
> needs to be on one line in chapter 17 of /Perl Best Practices/.  I just read
> the chapter last night, otherwise I wouldn't be replying to this thread :)

It's ok. Just be aware that many things in Perl Best Practices are not
best practices. It's a good place to start from but you'll need to
evaluate whether its really a good idea or not.

With mutli-dot versions, the simplest problem is how to sort the these
couple versions 1.10.0, 1.2.0.

In perl, the best practice really is to just assign a very simple
single dotted string to $VERSION and to from the very beginning of
your versions, insist on a set number of digits in each part. If you
once wrote '0.01', then you will always write in x.xx form and never
drop "redundant" zeros off the end.

  $VERSION = '0.01';
  $VERSION = '1.10';
  $VERSION = '2.00';
  $VERSION = '2.04';

but not:

  $VERSION = '0.01';
  $VERSION = '1.1';
  $VERSION = '2';
  $VERSION = '2.04';


More information about the spug-list mailing list