On Mon Oct 05 15:48:33 2015, SREZIC wrote:
Show quoted text> On 2015-09-30 18:52:26, ETHER wrote:
> > This is an acceptable way of indicating a trial release:
> >
> > our $VERSION = '1.002_003';
> > $VERSION = eval $VERSION;
> >
> > This is not:
> >
> > our $VERSION = '1.200_003';
> >
> > as if someone later says: use Foo 1.003; they will get the warning:
> > Argument "1.002_003" isn't numeric in subroutine entry at <line
> > number
> > of the use statement>
> >
> > We should be able to detect this by loading the .pm file (inside an
> > eval, in case it has errors -- maybe inside a Safe compartment?) and
> > looking for $VERSION variables in all defined namespaces.
It should be done in a Safe compartment that denies to load other stuff (and other dangerous/irrelevant operations) so that we don't need to care dependencies of a target module.
Show quoted text>
> Even the eval trick is problematic: a trailing zero gets lost this
> way. This happened to me once, check out the release history of
>
https://metacpan.org/release/Tk --- 804.030 is listed there as 804.03.
> Currently I strip the underscore with a s///:
>
> $VERSION =~ s{_}{};
>
> (no /g, as I expect that there's only one underscore ever in the
> $VERSION string)
Proper treatment of trailing 0(s) in a version may worth another metric.