Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2021-08-02 02:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (19 votes). Check out past polls.

    Notices?