On Sun, Apr 19, 2009 at 4:42 PM, Michael G Schwern <schw...@pobox.com> wrote: > And that's that. Have version.pm *always* output at least X.Y.Z. X.Y becomes > X.Y.0 or is simply disallowed. Then there's no confusion and no special vX.Y > format.
The problem I could see is what to do with alpha versions (an arguably bad legacy decision): X.Y_Z Is it a number? Or is it a tuple? I sort of prefer the opposite approach -- anything with a leading v is a tuple (splitting on "." or "_"), ideally with at least 3 components. Anything without is a number. Anything with multiple dots without a leading "v" is an error (but we should do the right thing anyway). That seems pretty unambiguous to me. In that case, version.pm should never output something with multiple decimal points without a leading v. I think that's what normal() does, right? I'm confused whether the issue is that people still don't know how to create/convert version numbers/objects sanely or whether the issue is that people don't always output in normal form. I wonder how much of this problem would have gone away if there wasn't the option to stringify or numify and version.pm just took in whatever and only put stuff out in a very strict form. We've given people the option to get it wrong. Maybe having different sugar for legacy conversion might be all that is necessary. $v = qnv("1.1"); # legacy conversion -> v1.100.0 $v = qnv(1.1); # legacy conversion -> v1.100.0 $v = qv("1.1"); # wrong, but deal with it -> v1.1.0 $v = qv(1.1); # also wrong, but deal with it -> v1.1.0 $v = qv("v1.1"); # proper way to specify v1.1.0 -- David