Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: What basic things should I know about versioning modules?

by haukex (Bishop)
on Feb 23, 2017 at 12:50 UTC ( #1182640=note: print w/replies, xml ) Need Help??

in reply to What basic things should I know about versioning modules?

Unfortunately, I can't find the source at the moment, but I remember reading somewhere that the "best" way to define a package version is simply

our $VERSION = "1.23";

The reason being that this is the most compatible with the various Perl tools that parse code to find information on modules, and that tricks like parsing the version number out of an SVN tag ("$Revision$") may not work with all of them. I used a string in the above because using a decimal like 1.10 would print as "1.1" instead of "1.10".

See "Version numbering" in perlmodstyle, which advocates version numbers like 1.00, 1.10, 1.11, 1.20 etc. Also, quoting from perlmodlib and Exporter:

To be fully compatible with the Exporter and MakeMaker modules you should store your module's version number in a non-my package variable called $VERSION. This should be a positive floating point number with at least two digits after the decimal (i.e., hundredths, e.g, $VERSION = "0.01"). Don't use a "1.3.2" style version.

Since the UNIVERSAL::VERSION method treats the $VERSION number as a simple numeric value it will regard version 1.10 as lower than 1.9. For this reason it is strongly recommended that you use numbers with at least two decimal places, e.g., 1.09.

There are also lots of other different versioning schemes in use by modules on CPAN. See also CPAN::Version.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1182640]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2022-01-22 12:31 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (62 votes). Check out past polls.