Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Don't use version.pm and don't listen to Perl Best Practices on this one. This is a classic example of somebody writing up a recommendation on something brand new (the author's own creation). A few months of experience showed problems with the idea, but it isn't like the book is going to be republished to discuss those.

Make your version numbers very simple, values that can be interpreted as numbers and that always sort the same whether treated as numbers or as strings. Avoid trying to assign meaning to your version strings or parts of them.

So I just always follow Perl's lead and use 1.001_001 forms of version numbers. Though I avoid Perl's idea of assigning meaning to whether or not the middle part is odd or even.

I also skip multiples of 10 for the 2nd and 3rd parts and don't let the third part go above 99. If the 2nd part goes above 99, then I skip to 111 to avoid the second digit being 0. This is so the break-up is obvious even when the '_' is not present because you are seeing just the numeric value.

If you expect to get past version 9, then you should start with version 10 so you can avoid string sorting breaking down when you go from 9.x to 10.x.

Set you version number very simply such as via:

our $VERSION = 100.001_001;

so all of the different things that try to introspect for your version number without running your code have no problems.

- tye        


In reply to Re: Module version numbers best practice (KISS) by tye
in thread Module version numbers best practice by hippo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-16 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found