# from Nicholas Clark # on Saturday 18 April 2009 13:14: >On Sat, Apr 18, 2009 at 11:35:17AM -0700, Jan Dubois wrote: >> On Sat, 18 Apr 2009, Michael G Schwern wrote: >> > Let's count the different ways we might have to parse a version. >> > >> > X ok, sort it as a number. >> > X.Y hopefully that's a decimal number and not a dotted pair >> > X.Y_Z oh right, alpha versions. Strip _Z off and sort as X.Y >> >> No, you just drop the '_' and sort numerically as X.YZ > >I think you just proved the point :-)
Well, we all agreed long ago that it's a big mess, but we have vX.Y.Z versions, and so does perl v5.5.640, so what's the point? Or rather, what good does it do to make a point about it? Aside: apparently search.cpan.org still hasn't quite figured out that pause doesn't index any "TRIAL" tarballs -- which is the only way I've seen to flag an alpha release without putting underscores in your vX.Y.Z versions. http://search.cpan.org/dist/Date-Piece/ http://search.cpan.org/search?module=Date%3A%3APiece >>> X.Y.Z dotted triad. split and compare X, Y and Z individually That's how strings work too, isn't it? I think vX.Y.Z versions are actually more Perlish than X.Y_Z (especially when 0 padding becomes necessary), but the "_" convention has always been troublesome. But some kind of alpha marker is necessary and "_" is currently the only one that's gotten widespread support -- hackish as it may be. >>> To this end, the META.yml version should be normalized to a simple >>> decimal. use version->numify. What is gained by doing this? And how does it fit what David said about the archive name? And what does 'alpha' or 'do not index' have to do with it? I think the 4 things version numbers are needed for are basically: 1. Compare versions (with the perl runtime, or as data|dependencies). 2. Construct an archive name. 3. Navigate the PAUSE indexer (parse an archive name?) 4. Deconstruct/compare/manipulate dists (search/meta tools) So, maybe numify works, but I suspect that it causes more problems than it solves until all 4 of these uses have accounted for vX.Y.Z versions and some sort of 'alpha' marker. Maybe you can forget about constructing an archive name from META.yml and even put the alpha flag in there. Some meta tools do need to reconstruct an archive name, but they will have to map $dir->list through a parse+numify to get there. --Eric -- Those who cannot remember the past are condemned to repeat it. --George Santayana --------------------------------------------------- http://scratchcomputing.com ---------------------------------------------------
