John Peacock wrote:
> Julian Mehnle wrote:
> > But doesn't `perldoc version` say that I am "strongly encouraged to
> > use the qv() operator" if I wanted to use extended versions?  Does
> > that recommen- dation perhaps need to be further qualified then?
>
> You skipped over the previous paragraph:
> > Whichever of the two types of version objects that you choose to
> > employ, you should stick to either "Numeric Versions" or "Extended
> > Versions" and not mix them together.  While this is possible, it is
> > very confusing to the average user.
>
> This is precisely what you are doing.  Sometimes Mail::SPF has one
> decimal place and sometimes it has two.  Even though you are using qv()
> to force extended version syntax, it looks (from the string point of
> view that CPAN hews closely to) like you are mixing your usage.

Well, I didn't consider CPAN(.pm) to be an "average user" so I didn't 
assume this paragraph would apply to it.  But now I see there's signifi- 
cant confusion about all the tools' different expectations, so I'll try to 
avoid too much variation in the future.

> If you want to use extended versions, do so and make your version always
> contain a leading 'v' and two decimals, even if the point release is 0
> most of the time.
>
>       use version; our $VERSION = qv('v2.4.0');
>
> This still doesn't fix the problem that older CPAN releases continue to
> perform stringwise comparisons, but at some point, it becomes silly to
> try and deal with people who refuse to update their core tools (like
> CPAN).  With the current release of version.pm, you can use the
> following instead:
>
>       use version; our $VERSION = qv('v2.004.0');
>
> and it _will_ sort properly even by older CPAN standards (and yet be
> exactly the same "version" as the other example).

I will try that.  If I consistently use two dots, do I still need the 'v'?  
Or is that prone to confusing CPAN again?

And, out of curiosity, how old would someone's CPAN version have to be in 
order to gracefully handle the latter but not the former?  I couldn't find 
anything about it in CPAN's changelogs.

Thanks everyone for all the advice given!

Julian.

Attachment: pgp8oNmLVOOul.pgp
Description: PGP signature

Reply via email to